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.

Add levels on different conditions

Thread ID:

Created:

Updated:

Platform:

Replies:

118095 Jan 31,2015 12:10 AM Feb 3,2015 04:26 AM Windows Forms 3
loading
Tags: GridGroupingControl
Rasika
Asked On January 31, 2015 12:10 AM

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

Neelakandan Kannan [Syncfusion]
Replied On February 2, 2015 05:40 AM

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


Rasika
Replied On February 2, 2015 06:32 AM

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

Regards,
Rasika

Neelakandan Kannan [Syncfusion]
Replied On February 3, 2015 04:26 AM

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

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.

;