Wednesday, 7 August 2013

Select a row in Devxpress datagrid using a button (C#)

Select a row in Devxpress datagrid using a button (C#)

Ok so I have this Devexpress 13 Xtragrid.gridcontrol..
I can find the row that is selected, using this code:
int[] selRows = ((Gridview))grdMygrid.Mainview).GetSelectedRows();
DataRowView selRow
(DataRowView)(((Gridview)grdMyView.MainView).GetRow(selRows[0])); int
SelectedIndex = selRows[0];
Now, this works like a charm... Only I added some navigation buttons with
which I want to be able to scroll through the gridcontrol. (next,
previous, last, first)
I can't seem to set the row in code. Somebody here have an idea on how to
accomplish this?
I'm looking for something like this: myGrid.SelectedRow = SelectedIndex();
Thanks

No comments:

Post a Comment