I would like to change the selection row according to the value entered in telerik winforms radGridView.

1 Answer 20 Views
GridView
arbam
Top achievements
Rank 1
Iron
arbam asked on 18 Jul 2022, 03:18 PM
With datasoure entered in gridview, I want to focus the row that corresponds to the value by sending the value to the function.

ex)GridView
Column1 Column2
Row1 a1 a2 >> now Focus
Row2 b1 b2

I want to focus on Row2 when I enter b1 in >> function.

private void FocusedRow(string Value){
    for(int i =0; i< grid.RowCount; i ++){
        if(grid.Rows[i].Cells[0].Value.ToString() == Value){
               grid.ClearSelection();
               grid.Rows[i].isSelected = true;
         }
     }
}
>>Current function I created.

1 Answer, 1 is accepted

Sort by
0
Maria
Telerik team
answered on 19 Jul 2022, 08:14 AM

Hi Konyang,

From what I see from your code snippet I assume that by focused row you mean the current row. So I can suggest by selecting a single row you have to set IsSelected = true; and if you want to make the row current, set this property IsCurrent = true;

I am sending you a link to the documentation as well: Selecting Rows and Cells.

I hope this will work for you.

Regards,
Maria
Progress Telerik

The Premier Dev Conference is back! 

Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.


Tags
GridView
Asked by
arbam
Top achievements
Rank 1
Iron
Answers by
Maria
Telerik team
Share this question
or