DevExpress Gridview FocusedRowHandle setter不设置新值

时间:2017-07-17 13:49:49

标签: c# gridview devexpress

DevExpress.XtraGrid.Views.Grid.GridView的FocusedRowHandle的setter似乎没有设置值,它保持不变。存在具有旧句柄和新句柄的行。我似乎也没有例外。为什么不起作用?如果重要的话,网格是多选的。

[...]
for (int i = this.GetMasterView().DataRowCount - 1; i > -1; i--)
                {
                    var row = this.GetMasterView().GetRow(i);
                    if (Equals(row, focused))
                    {
                        this.GetMasterView().FocusedRowHandle = i;
                        this.GetMasterView().ClearSelection();
                        this.GetMasterView().SelectRow(i);
                        ret = true;
                        break;
                    }
                }
[...]

public static GridView GetMasterView(this GridControl gridControl)
        {
            return (GridView) gridControl.MainView;
        }

0 个答案:

没有答案