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.
ADAdministrator Syncfusion Team March 15, 2004 10:05 AM
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
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.
ADAdministrator Syncfusion Team April 10, 2006 08:14 PM
Are there any code samples available that illustrate importing into a CollapsibleDataSource class from an XML file? Data that is not serializable.
ADAdministrator Syncfusion Team April 11, 2006 05:50 AM
Please refer to this forum thread that has a sample which populates the CollapsibleDataSource.data with a data set, to see if that helps.