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.
Unfortunately, activation email could not send to your email. Please try again.

Finding and highlighting a grid row when the datarow is known

Thread ID:

Created:

Updated:

Platform:

Replies:

10929 Feb 17,2004 08:09 AM Feb 17,2004 10:32 AM Windows Forms 2
loading
Tags: GridControl
Doug Lind
Asked On February 17, 2004 08:09 AM

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

Administrator [Syncfusion]
Replied On 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

Doug Lind
Replied On 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 > >

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;