DevExpress GridView:如何select第一行按降序排序后

DevExpressGridView: How to select the first row after sorting it by descending order

假设你有一个GridView(DevExpress),你如何select排序后的第一行?

gridView1.OptionsBehavior.KeepFocusedRowOnUpdate = false;
colCreatedDate.SortIndex = 0;
colCreatedDate.SortOrder = DevExpress.Data.ColumnSortOrder.Descending;

这东西只在 select 排序前的第一行不起作用。

gridView1.Columns.View.MoveFirst();
gridView1.FocusedRowHandle = 1;
gridView1.FocusedColumn = colCreatedDate;

我现在意识到我的问题了。在对 Gridview 排序后的第一行调用 select 事件后,首先对所有行进行排序。

private void gridView1_EndSorting(object sender, EventArgs e)
{
   gridView1.FocusedRowHandle = 0;
}