In an attempt to set up a grid using hierarchical data model without a Dataset, I am at a loss how to define the data model.
I have 2 different data types
public class data1 { public string field1 {get; set;}}
public class data2 { public string field 2{get; set;}}
I would like the grid to diplay in band 1 as data1 and in band 2 as data2. I have used BindingList <T> as all the same type and the grid has no problem interpreting the data objects.
Joby
In order for this to work as a hierarchy in DotNet DataBinding, what you would do is expose a property on the data1 class which returns a BindingList<data2>. Then you would bind the grid to a BindingList<data1>.
I am sorry I have been a bit misleading in my description after reading the responces.
What I wanted was data 1 to be the first row of band 1 and data 2 to be the second row of band 1.
So the 2 data types are peers in the tree.
You cannot do that at the root level of the grid. The band only has one set of columns, so the data has to be homogenous.
If you want to display different types of data as siblings, then you would have to create a parent band with two sibling child bands. Or, you could display this with UltraWinTree which does not require the data to be homogenous, but lacks certain grid features like filtering and summaries.
Thank you I will look into the UltraWinTree.