Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我怎么可能获得 DataGrid 的选定行索引,然后手动设置它?
问候
佩索尔
获取选定的行索引:
int i = myDataGrid.SelectedIndex;
设置选定行索引:
myDataGrid.SelectedIndex = 4;