Hi
I am using RadControls for WinForms Q2 2010 SP1 in .NET 3.5.
I would like to bound hierarchy structure to RadGridView that is not DataSet.
My structure is quite simple:
1. On the top is class ContentTargetFolder:
public class ContentTargetFolder { private string _name; public string Name { get { return _name; } } /*…here I have other properties to display*/ private List<Package> _packages; public List<Package> Packages { get { return _packages; } } … }
2. Package class:
public class Package { /*…Properties to display…*/ private List<PackageItem> _packageItems = new List<PackageItem>(); public List<PackageItem> PackageItems { get { return _packageItems;}} … } 3. PackageItem class:
public class PackageItem { /*…Properties to display…*/ }
I have List< ContentTargetFolder> CTFs object and I do this:
this.radGridView1.BeginUpdate(); this.radGridView1.MasterTemplate.Reset(); this.radGridView1.AutoGenerateHierarchy = true; this.radGridView1.DataMember = string.Empty; this.radGridView1.DataSource = CTFs; this.radGridView1.EndUpdate(); The problem is that I get flat list, Packages property from class ContentTargetFolder is displayed as normal property it is not treated as collection of objects.
How can I solve this problem?
Regards