Hello!
I have 5 objects:
object 1 is root, object 2 and 3 in subroot, objects 4,5 in subsubroot :)
here is the hierarchy:
object1
object2
object4
object3
object5
Is it possible to make this hierarchy in xamWebGrid?
Thank you.
Thank you Stephen!
You helped me much.
Hi,
So, basically the grid is made up of Columns. And a column represents a public property in your data. When AutoGenerateColumns is turned on (and it is by default). The xamWebGrid looks at an object in your data source, and determines the Columns that it needs to create. For example for a bool property the xamWebGrid will create a CheckBoxColumn.
Now, the important thing to take away from this, is that when the xamWebGrid comes across an IEnumerable property, it will create a ColumnLayout. And a ColumnLayout represents another level of data and Columns.
The xamWebGrid does support multiple childBands, so all you need to do, is have 2 properties in your data object of type IEnumerable, one a collection of sub_object1 and the other a collection of sub_object2, and the xamWebGrid will do the rest.
The following help articles actually go into greater detail and might help explain things a little better.
Columns
Defining ColumnLayouts
Hope this helps,
-SteveZ
Hello.
Sorry, I don`t get about this case of hierarchy:
root_object
sub_object1
sub_object2
Is it possible for xamWebGrid?
Thank you very much!
Thank you, Alex.
You helped me much!
Hello,
I can see no reason why this is not possible. You need to create a hierarchy of classes, where the parent has a property, which is a collection of sub objects. Something like this:
public class ParentObject
{
public List<SubObject> Sub { get; set; }
}
public class SubObject
public List<SubSubObject> SubSub { get; set; }
public class SubSubObject
public string ID { get; set; }
Set the AutoGenerateColumns="True" property of the XamWebGrid to true and you are all set