I had some trouble getting an SPDataSource to work with DevExpress's ASPxTreeList. It was not showing any useful fields from the data source like the web title (I was getting a list of webs). Instead it had a column for some of the properties of the SPDataSource it self - so weird!
So, I set ASPxTreeList.AutoGenerateColumns = false, created my own TreeListDataColumn for the __spTitle field, and added the column to the tree list's Columns.
// get the list of webs
SPDataSource spds = new SPDataSource();
spds.DataSourceMode = SPDataSourceMode.Webs;
spds.SelectParameters.Add("WebUrl", "/");
treeList = new ASPxTreeList();
treeList.DataSource = spds;
treeList.KeyFieldName = "__spID";
treeList.ParentFieldName = "__spParentWebId";
treeList.AutoGenerateColumns = false; // because it generates the wrong ones
TreeListDataColumn colTitle = new TreeListDataColumn("__spTitle", "Name");
treeList.Columns.Add(colTitle);
treeList.DataBind();
Controls.Add(treeList);
Now it correctly lists the name of each web, like I wanted.
See Also


Good Day!
Please help small example how to make tree(left) and main window (right)
url
http://documentation.devexpress.com/#AspNet/CustomDocument3943
prof3000@gmail.com
Best Regard's
Posted by: Sergey | 06/29/2011 at 07:45 AM
Sorry, Sergey, this is as far as I took the list control. I also wanted a tree on the left and window on the right, and I found it with Telerik's Rad File Explorer control.
Posted by: meowkins | 06/29/2011 at 11:52 AM