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.
Syncfusion Feedback

Grid Grouping Control Add/Remove Child Table at runtime

Thread ID:

Created:

Updated:

Platform:

Replies:

104747 Aug 14,2012 08:59 PM UTC Aug 31,2012 06:37 AM UTC ASP.NET Web Forms (Classic) 2
loading
Tags: GridGroupingControl
TD
Asked On August 14, 2012 08:59 PM UTC

I've a requirement to display child table in GridGroupingControl at runtime.

I've a PlusMinus Cell in parent grid for all the rows, so when I expand the specific row, I should query data and create a child table for that row.

So, How to add child table at runtime to a specific row?

Also, need to remove data on collapse.

Any help would be appreciated.

Thanks!

TD
Replied On August 16, 2012 08:42 PM UTC

Well, I sort of resolved the issue of dynamically populating child table and it works if I have parent/child relation keys defined appropriately. However, I've a requirement where both the tables should display data independently without any relationship. So, I tried this:

GridRelationDescriptor childRelationDescriptor = new GridRelationDescriptor(CHILD_RELATION_DESCRIPTOR);
            childRelationDescriptor.ChildTableName = CHILD_TABLE_NAME;
            childRelationDescriptor.RelationKind = RelationKind.RelatedMasterDetails;
            
            // it could be valid column names from parent/child tables
            childRelationDescriptor.RelationKeys.Add("ID", "ID");  
            .TableDescriptor.Relations.Add(childRelationDescriptor);
            
            //pre-populate empty child table            
            GridGroupingControl.Engine.SourceListSet.Add(CHILD_TABLE_NAME, GetChildDataCollection());

I've configured "OnRecordExpanded" event to expand data and populate child table with this code:

GridGroupingControl.Engine.SourceListSet.Add(CHILD_TABLE_NAME, RePopulateChildDataCollection());
GridGroupingControl.TableDescriptor.EnableOneTimePopulate();

With the above code, data are displayed appropriately on the grid whenever the row gets expanded for the first time. However, whenever I tried to expand another row keeping the old one expanded, the page post-back event occurs and that basically resets the grid-view with all rows collapsed.

The grid works fine if I use valid RelationKeys from parent and child tables.

Any thoughts or suggestions?


Yogeshwaran [Syncfusion]
Replied On August 31, 2012 06:37 AM UTC

Hi Trushith,

 

Thanks for using Syncfusion products.

 

Yes it is good one to change data of child table at run time in record expanded event.

 

Please let us know if you have any other concerns.

 

Regards,

Yogesh R


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

;