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

GDBG. How can I get RowIndex for specified DataRow object?

Thread ID:





16893 Jul 27,2004 04:29 AM UTC Jul 28,2004 11:49 AM UTC WinForms 4
Tags: GridControl
Asked On July 27, 2004 04:29 AM UTC

Hi. I have dataset with two related tables. And I have DataRow object from child table. How can I get RowIndex for specified DataRow object?

Administrator [Syncfusion]
Replied On July 27, 2004 05:35 AM UTC

There is no simple way to to this. You will have to get the parent row object somehow, find its rowindex in the grid, and then iterate through its child table to find the row object you are looking for. Alternatively, if the grid is displaying a column from your child table with unique values, and teh grids involved are not terribly large, you could iterate through all the rws in the grid looking for the particular child. Take a look at this whole thread. At the bottom, there is a sample that does this. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=16782

Replied On July 28, 2004 08:29 AM UTC

I use gdbg for displaying realtime data. And when realtime data is received from dataprovider I find correspond row in my dataset, then change that row and then refresh gdbg. But I don''t want to refresh entire grid. I want to refresh only corresponding rows. are there any ways to implement it? Regards, Slava.

Administrator [Syncfusion]
Replied On July 28, 2004 09:29 AM UTC

I think you will have to dynamically subscribe and unsubscribe to the child table''s ListChanged event for each parent node in RowExpanding and RowCollapsing. Then you can maintain a hastable of these child tables and the location of their parentrows. Then in the ListChanged handler, you can retrieve the parent row and use the e.NewIndex to determine the grid row that needs refreshing. (Note that when a parent row collapses, you may have to adjust the row values in the hashtable.) Here is a minimal sample that seems to be working ok. As you press the button on the form, a different child row is modified, and only that child row is refreshed. UpdateChild_7608.zip

Replied On July 28, 2004 11:49 AM UTC

Yes. Thanks. Now it is realy good performance.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon