Chetan Sanghani Chetan Sanghani - 6 months ago 27
Vb.net Question

Row of GridControl Focused on Textbox Value

I have a

gridcontrol
of
devexpress
.I want the Focus on particular row according the
Id
which I entered in the
textbox
above the GridControl.

E.X.
If I enter 10 in textbox then in the gridCOntrol the row having Id = 10 got focused.


So help me for this.
Thanks.

Answer

This can be done using the following code:

    int rowHandle = gridView1.LocateByDisplayText(0, gridView1.Columns["Id"], "10");
    if(rowHandle != GridControl.InvalidRowHandle)
        gridView1.FocusedRowHandle = rowHandle;