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

VirtualTreeGrid sample problem

I think I am missing something with this sample. It seems to come with a data file (*.cds) that already has the hiearchy in place. But nowhere in the code do I see a way to create the hiearchical data set, only a way to create a flat set. Thus when trying to move the code to another app, there is no sample data set that can be used, since the data set that comes with it has its persisted version tied to the sample''s assembly. Any ideas?

3 Replies

AD Administrator Syncfusion Team March 15, 2004 03:05 PM UTC

In that sample, to use your own data, you would have to write code that creates a CollapsibleDataSource object that holds your data. This means you would modify the code in SampleData file. You would create and populate a CollapsibleDataSource.data object using code similar to that in CollapsibleDataSource.InitData. As you add each object to the CollapsibleDataSource.data, you would set its expandstate and indentlevel to reflect what you want that row to have. If you comment out the //ReadData("datasample.cds"); in the FormLoad, then you will see the flat table set up by calling InitData. You can then right-click the left cell, and set its indent level to make this flat table look like a tree. The idea is that you can do the same thing from code as you create the CollapsibleDataSource.data. Once you have your table created, you can serialize it in the cds format so it then could be read from file from that point on. But the first cds structure either has to be done from code, or from the UI (rightclicking etc.). This sample does not use the standard AddNode/RemoveNode sturcture you might see in a treeview.

AD Administrator Syncfusion Team April 11, 2006 12:14 AM UTC

Are there any code samples available that illustrate importing into a CollapsibleDataSource class from an XML file? Data that is not serializable. Thanks! eric

AD Administrator Syncfusion Team April 11, 2006 09:50 AM UTC

Hi Eric, Please refer to this forum thread that has a sample which populates the CollapsibleDataSource.data with a data set, to see if that helps. Regards, Calvin.

Live Chat Icon For mobile
Up arrow icon