I have a GridView in my Winform application and its datasource is bound to a list of custom objects. Let's assume this custom object has 2 fields: name and ID, so the gridview has also 2 columns: name and ID. (name first, then the ID).
Now I want to select the row that has the given ID.
How can I select it? gridView1.Rows[0].IsSelected = true; is not OK here, because I don't know the index of the row.
The GridView has DataSource set this way (of course this is a simple example):
List<MyObject> myList=new List<MyObject>();
myList.Add(new MyObject("name1", 1));
myList.Add(new MyObject("name2", 2));
gridView1.DataSource = myList;
Thanks for your help