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.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

16893 Jul 27,2004 12:29 AM Jul 28,2004 07:49 AM Windows Forms 4
loading
Tags: GridControl
Silenter
Asked On July 27, 2004 12:29 AM

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 01:35 AM

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

Silenter
Replied On July 28, 2004 04:29 AM

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 05:29 AM

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

Silenter
Replied On July 28, 2004 07:49 AM

Yes. Thanks. Now it is realy good performance.

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.

;