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

Retrieving Child Data on RowExpand Event?

Thread ID:

Created:

Updated:

Platform:

Replies:

28180 Apr 26,2005 10:37 AM UTC May 9,2005 04:02 PM UTC WinForms 6
loading
Tags: Grouping
Theo Danzfuss
Asked On April 26, 2005 10:37 AM UTC

Hi, I have a Parent-Child relation set on my Grouping control, the problem is that the data in my ChildTable are extremely big. I want to retrieve the related child data on the rowExpanding event of my grouping control. How would I do this? Can I set up my relationship when there''s no data in the childTables? Can you please give me a code snippet of how to do this. Thanks Theo Danzfuss

Administrator [Syncfusion]
Replied On April 28, 2005 08:04 PM UTC

Hi Theo, I created a small sample that populates the child/details table only the first time the user expands a record of the parent table. You can download it here: CS.zip Stefan

Theo Danzfuss
Replied On May 3, 2005 03:36 PM UTC

Stefan, The only change I made was to call the PopulateTable() method on the "this.gridGroupingControl1.GroupExpanded" event after calling, this.gridGroupingControl1.Table.CollapseAllRecords ( ); I now have the behaviour I want. Thanks alot! TD >Hi Theo, > >I created a small sample that populates the child/details table only the first time the user expands a record of the parent table. > >You can download it here: CS.zip > >Stefan >

Administrator [Syncfusion]
Replied On May 3, 2005 04:07 PM UTC

Hi, I got too happy, too quickly. See my attached example. It works correctly AS-IS, Each table gets populated when the Tablename gets expanded from the parentRow. BUT when I remove the GrandParentTable Relationship, it doesn''t work correctly anymore - you''ll see that the Groups Aren''t collapsed when you expand the parent row, and you have to first Close the group and then Re-open it before it gets populated. Also once you have expanded one parent row ALL parent Rows are expanded - this is also a problem seeing that in my final app, Ill populate the ChildTable Per Record - The populateTable method wont populate all the rows, but only those applicable for the selected parent Row. Can you please help me with this. Thanks TD CS_modified_8172.zip

Administrator [Syncfusion]
Replied On May 3, 2005 06:05 PM UTC

I think I was able to get this working by adding an e.Record.ParentChildTable.CollapseAllRecords call after the PopulateChildTable call. (I tried it using both 3.0.1.0 and 3.2.1.0.)
private void gridGroupingControl1_RecordExpanding(object sender, RecordEventArgs e)
{
	if ( childTable.Rows.Count <= 0 )
	{
		PopulateChildTable ( childTable );
		e.Record.ParentChildTable.CollapseAllRecords();
	}
}

Theo Danzfuss
Replied On May 5, 2005 06:47 AM UTC

Hi, It works fine if you do it on the RecordExpanding event, but I need to do it on the GroupExpanding event. In my Scenario there are typically 5-10 ChildTables, and I can''t retrieve ALL childtable Data on the RecordExpanding event, I must do it on the GroupExpanding event - this allows me to know what ChildTable data to retrieve. If I do the same on the GroupExpanding event, then It closes all my open rows - you must be able to have existing rows open! TD

Administrator [Syncfusion]
Replied On May 9, 2005 04:02 PM UTC

Hi, I got it working with this sample code by making sure the child groups are initially not expanded. This can be accomplished by handling the GroupAdded event. private void gridGroupingControl1_GroupAdded(object sender, GroupEventArgs e) { e.Group.IsExpanded = false; } Attached find sample code compilable with 3.2.1.0 CS.zip Stefan >Hi, > >It works fine if you do it on the RecordExpanding event, but I need to do it on the GroupExpanding event. >In my Scenario there are typically 5-10 ChildTables, and I can''t retrieve ALL childtable Data on the RecordExpanding event, I must do it on the GroupExpanding event - this allows me to know what ChildTable data to retrieve. >If I do the same on the GroupExpanding event, then It closes all my open rows - you must be able to have existing rows open! > >TD

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

;