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

Add levels on different conditions

Hello,
I am using gridgrouping control.
I want to create parent-child,child-grandchild and so on relationships.
I have multiple conditions by which I bind the control with different levels.
sometimes I have 2 levels, sometimes 3 levels and it is up to 6 levels structure in a single control.
Is there any possibility to pass level numbers and binding tables to a single function or class and 
then that class's code will automatically generate relation descriptors using the level numbers?

Thanks and regards,
Rasika

3 Replies

NK Neelakandan Kannan Syncfusion Team February 2, 2015 10:40 AM UTC

Hi Rasika,

 

Thank you for your interest in Syncfusion products.

 

We would like to let you know that we have already provided the Dashboard sample regarding manual relations at any level. In this sample, we have added table(child table) for Grid at various levels by specifying each table at specific index.

 

Code Snippet:

newList[0].ChildTables.Add("List0_Child0", list); //Adding child table at 0th position

newList[1].ChildTables.Add("List1_Child0", list); //Adding child table at 1st position

newList[3].ChildTables.Add("List3_Child0", list); //Adding child table at 3rd position

 

Dashboard Sample:

<Installation Location>\Syncfusion\EssentialStudio\<Product Version>\Windows\Grid.Grouping.Windows\Samples\Data Sources\Nested Child-Collection Demo\

 

Please let me know if you have any concerns.

 

Regards,

Neelakandan



RA Rasika February 2, 2015 11:32 AM UTC

Thank you for reply.
Could you send some sample code for this?

Regards,
Rasika


NK Neelakandan Kannan Syncfusion Team February 3, 2015 09:26 AM UTC

Hi Rasika,

 

Thank you for your update.

 

Here we have provided the sample code as per your need. Please make use of below code and attached sample,

 

Code Snippet:

//The main list

list = new BaseClassList();

list.Add(new FirstClass(null, 0, "row0"));

list.Add(new FirstClass(null, 1, "row1"));

list.Add(new FirstClass(null, 2, "row2"));

list.Add(new FirstClass(null, 3, "row3"));

list.Add(new FirstClass(null, 4, "row4"));

newList = list;

 

#region Child Tables of List[0]

//First Child of List[0]-First level

list = new BaseClassList();

list.Add(new SecondClass(newList[0], 0, "row0_childtable0_row0"));

list.Add(new SecondClass(newList[0], 1, "row0_childtable0_row1"));

list.Add(new SecondClass(newList[0], 2, "row0_childtable0_row2"));

list.Add(new SecondClass(newList[0], 3, "row0_childtable0_row3"));

list.Add(new SecondClass(newList[0], 4, "row0_childtable0_row4"));

list.Add(new SecondClass(newList[0], 5, "row0_childtable0_row5"));

newList[0].ChildTables.Add("List0_Child0", list);

 

Please let me know if you have any concerns.

 

Regards,

Neelakandan


Attachment: Nested_ChildCollection_Demo_92c3c1ca.zip

Loader.
Up arrow icon