I have two grid views namely PositionsReadyListGridView
and PositionsNotReadyListGridView
.
Now the functionality requirement is on click of Button Set Not Ready
the selected item from PositionsReadyListGridView
is removed from this list and added to PositionsNotReadyListGridView
.
Similarly on click of Button Set Ready
the selected item from PositionsNotReadyListGridView
is removed from this list and added to PositionsReadyListGridView
.
I have implemented this functionality but I am unable to set Focus on the latest row which is added to the either of the GridView.
Is there a way that I can set Focus to the row according to cell values?
For example in both of the Grids I have a column colID
which is unique to a row.
Can I somehow use this ID to set Focus to the row added to either PositionsReadyListGridView
(on Set Ready click) or PositionsNotReadyListGridView
(on Set Not Ready Click)?
Thanks
You can use LocateByValue
method, which returns RowHandle
of located row and set this value to FocusedRowHandle
property:
int rowHandle = PositionsReadyListGridView.LocateByValue("colID", ID);
if (rowHandle != GridControl.InvalidRowHandle)
PositionsReadyListGridView.FocusedRowHandle = rowHandle