How can I select a specific row in the gridview depends on one textbox
for example I have one textbox (txtIDNO)
and one gridview (gridview1)
the gridview1 contains on columns (colIDNO, colIDNAME)
what I want is when the user write a number inside the textbox
the row that contains on same this number will select it inside the gridview
Thanks for your reply
I tried ColumnView.LocateByValue method
but its not select the row
with normal datagridview I can do it with the following code:
Dim s As String = f2.txtCRSNO.Text.Trim
For x As Integer = 0 To f2.GridView1.Rows.Count - 1
If CStr(f2.GridView1.Rows(x).Cells("colCRSNO").Value).StartsWith(s) Then
f2.GridView1.FirstDisplayedScrollingRowIndex = x
f2.GridView1.Item(0, x).Selected = True
but with DevExpress XtraGrid I can not do it,
I apologize for an incomplete answer. As written in the corresponding help topic, the LocateByValue method finds a row and returns its handle. Then you can assign this row handle to the ColumnView.FocusedRowHandle property to select this row and make it visible.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.