【问题标题】:how to set focus row on XtraGridControl Devexpress?如何在 XtraGridControl Devexpress 上设置焦点行?
【发布时间】:2014-04-17 10:46:13
【问题描述】:

我有一个要在 XtraGridControl 上显示的列表项。我想要网格控件的第一项,当我按任何列排序时总是选择它。我试图找到并使用 FocusedRowHandle 属性,但没有。

我可以使用哪些属性以编程方式将第一项聚焦在 XtraGridControl 上?

提前感谢。

【问题讨论】:

  • gridView1.FocusedRowHandle = 0;
  • XtraGridControl 没有 FocusedRowHandle 属性 :(
  • 试试gridControl.MainView.FocusedRowHandle = 0;
  • gridControl.MainView 有焦点属性,而不是 FocusedRowHandle :|

标签: c# winforms devexpress xtragrid


【解决方案1】:

我自己解决了这个问题,使用 ColumnView 如下代码:

ColumnView cv = m_wndGridCtrl.MainView as ColumnView;
cv.FocusedRowHandle = 0;

感谢您的时间支持。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-27
    相关资源
    最近更新 更多