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
close icon

Populating grid on demand

Hi,

I'm using GridGroupingControl 4.2 and I need to populate children of row on expand. The problem is that I don't know initially how many levels are in the hierarchy.

So what I need is:
1) initially fill the first level of rows (this is not a problem)
2) on expand of a row check whether there are children of the expanded row. if children exist add a new child table and populate it. This is a problem because I don't get the plus sign to expand when there are no children
3) for different rows the depths of hierarchy can be different, e.g. the first row might have 3 child tables while the second might have 10. The table structure for each sublevel is always the same.

Is there any way to achieve this? Do you have a sample for this?

Thanks in advance,

Christian






3 Replies

NR Nirmal Raja Syncfusion Team November 20, 2008 08:51 PM UTC

Hi Christian,

Thank you for your interest in Syncfusion products.

The child table can be loaded on demand if the child table is shown in the dropdown of the parent record.

Please refer the sample in the following link:
LoadOnDemand

Regards,
Nirmal



IM Imran October 22, 2018 08:16 PM UTC

 Link mentioned in above comment is not valid therefore please provide the valid link


AA Arulraj A Syncfusion Team October 25, 2018 09:21 AM UTC

Hi Imaran, 

Thanks for using Syncfusion product. 

By default, GridGroupingControl does not have the on demand support for flat and child table. But, you can generate the child data while expanding the record using RecordExpanding event. Please refer the following code example and the sample, 

Code example 
this.gridGroupingControl1.Table.RecordExpanding += Table_RecordExpanding; 
private void Table_RecordExpanding(object sender, Syncfusion.Grouping.RecordEventArgs e) 
{ 
    DataRow dr = childTable.NewRow(); 
    dr[0] = 0; 
    dr[1] = string.Format("F2_{0}", 0); 
    dr[2] = string.Format("F2_{0}", 0); 
    dr[3] = 0; 
    childTable.Rows.Add(dr); 
    childTable.AcceptChanges(); 
} 


If you want to use the different child tables for every record, you could implement the List collection with ITypedList. Please refer our dashboard sample in following location, 
Installed Sample location: <Installed_Location>\Syncfusion\EssentialStudio\<Version_Number>\Samples\Windows\Grid.Grouping.Windows\samples\Data Sources\Nested Child-Collection Demo\cs 

Let us know whether this helps also if you need any further assistance on this. 

Arulraj A 


Loader.
Live Chat Icon For mobile
Up arrow icon