Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Binding XtraTreeList to Dataset in runtime

Hi all,

I'm experienced with unbound forms in VB6 and I'm now simultaneously learning C# and trying to figure out how to use bound forms at the same time, so fairly new to both!

What I'm trying to do is bind an XtraTreeList control to a dataset in runtime. On application start, a dataset is filled using a dataAdapter object, this works fine. I've used the designer to add two TreeListColumns and specified the appropriate FieldName properties. However, I have this code in the form's onLoad event:

private void MainForm_Load(object sender, System.EventArgs e)
{
TreeList1.DataSource = DataSet1;
}

This doesn't seem to work. The TreeList is empty, even though I know the SQL command in the dataAdapter returns one row. Have I missed out a step? I tried adding "TreeList1.PopulateColumns();" but this outputs "System.Data.DataView" in the TreeList. What am I doing wrong?

Thanks in advance,

Mat
[995 byte] By [dvdmat] at [2007-11-11 7:33:22]
# 1 Re: Binding XtraTreeList to Dataset in runtime
For help with third-party components, it's always best to try the vendor's support site first. I found this page: http://www.devexpress.com/Products/NET/XtraTreeList/QuickStart.xml
Phil Weber at 2007-11-11 21:49:00 >