views:

145

answers:

1

I need to display the xml data in the treelist control. I have one root node, one Child node and further four children for this child node.

I am not able to display it in the treelist. I am using the dataset.readXml method for reading the xml file and giving dataset as a datasource. Here is the code I am following:

DataSet dataSet = new DataSet();
dataSet.ReadXml(@"C:\foldersettings.xml");
treeList2.DataSource = dataSet;
treeList2.PopulateColumns();
treeList2.BestFitColumns();
treeList2.ExpandAll();

Can anyone tell me why am I not getting the data in treelist. I am using DevExpress 9.1 version control.

Thanks in advance!!

A: 

Hi,

You should also set the KeyFieldName and ParentFieldName properties of the TreeList. Note, these properties should be set to the corresponding field names in the CaseSensitive manner. Also, the TreeList's DataSource should be set to dataSet.Tables[0]. I hope, this will help.

DevExpress Team