We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Finding and highlighting a grid row when the datarow is known

Hi, I''ve got a requirement to programatically highlight (select) grid rows from a list of underlying datarows. What I need to know is how to locate a grid row based upon the datarow, and set the grid row as selected. BTW: I''m using a GridDataBoundGrid. Thanks, Doug

2 Replies

AD Administrator Syncfusion Team February 17, 2004 09:28 AM

You have to find the datarow in the current dataview, and then select. Exactly how you do that depends upon what the current dataview is. If it is sorted, then you can use DataView.Find looking for the sort keys. If it is not sorted, then I think you will have to iterate through the underlying list, and find it that way. If you can pass DataRowView objects, you could try using List.IndexOf method on the underlying list. Here is a sample that just looks through the list for the right position using a primary key to find the right row. forum10929_6790.zip


DL Doug Lind February 17, 2004 10:32 AM

Thanks Clay! >You have to find the datarow in the current dataview, and then select. Exactly how you do that depends upon what the current dataview is. If it is sorted, then you can use DataView.Find looking for the sort keys. If it is not sorted, then I think you will have to iterate through the underlying list, and find it that way. If you can pass DataRowView objects, you could try using List.IndexOf method on the underlying list. >Here is a sample that just looks through the list for the right position using a primary key to find the right row. > > > >forum10929_6790.zip > >

Loader.
Live Chat Icon For mobile
Up arrow icon