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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Finding and highlighting a grid row when the datarow is known

Thread ID:

Created:

Updated:

Platform:

Replies:

10929 Feb 17,2004 01:09 PM UTC Feb 17,2004 03:32 PM UTC WinForms 2
loading
Tags: GridControl
Doug Lind
Asked On February 17, 2004 01:09 PM UTC

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 02:28 PM UTC

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 03:32 PM UTC

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.

Warning Icon 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.Close Icon

;