Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
975
Binding Hierarchical Data to Grid
posted

 I hope someone can help me.

 I'm working on displaying hierarchical data in a xamDataGrid. The data that I'm using is retrieved as a flat list. I've created a class in the same way that the LibraryBusinessLogic is layed out in the xamFeatureBrowser. The only difference is that rather than having specific properties for the classes for different levels,they hold a custom "item" object, and also the collection of any child "item". The item object then contains the various properties such as ID, Description etc...

 The datagrid displays the data, but there is only one column named "Item" which then contains a long string of all the properties in the item object. I've tried  field layouts like this:

                <igDP:FieldLayout
                    Key="TopLevel"
                    >
                    <igDP:FieldLayout.Fields>
                        <igDP:Field
                            Name="ItemID"
                            />
                        <igDP:Field
                            Name="ItemDescription"
                            />
                        <igDP:Field
                            Name="LastScanned"
                            />
                        <igDP:Field
                            Name="LocationDescription"
                            />
                    </igDP:FieldLayout.Fields>
                </igDP:FieldLayout>

 But it seems whatever I do, it only displays one column.

 Is there any way to get it putting the properties into their own columns, or do I need to add public properties to each class to access the "item" properties that I want from it?

 I can provide more information if it's not clear what I'm doing but I didn't want to confuse the initial post too much!

 Many thanks!

Rob

Parents
No Data
Reply
  • 69686
    posted

     Hi Rob,

    A great way to display hierarchical data in the XamDataGrid is by ObservableCollection. I have recently created and posted a sample of that. Here is the link and hope this helps you. If you still have any trouble feel free to give me some more information on your problem.

    http://forums.infragistics.com/forums/t/20031.aspx 

Children