This is a migrated thread and some comments may be shown as answers.

Select a row by ID

1 Answer 117 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Raphaël MANSUY
Top achievements
Rank 1
Raphaël MANSUY asked on 29 Aug 2012, 09:12 AM
I have a simple question: my Grid is bound to a DataSet, and I want to programatically select a row by ID.
What is the most efficient way to do that?

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 03 Sep 2012, 08:51 AM
Hi Raphaƫl,

Thank you for writing.

You should find the Row in the grid and set its IsCurrent property to true. For example:
foreach (GridViewRowInfo row in radGridView1.ChildRows)
{
    if (row.Cells["ID"].Value == 5)
    {
        row.IsCurrent = true;
        break;
    }
}

I hope this helps.
 
Regards,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Raphaël MANSUY
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or