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
385
Display Child Property In Grid
posted

I want to bind a grid to a collection of objects.  Mostly I will just display properties of the objects. This is simple. But, I also want to display properties of those properties. Is that possible with the ultragrid? Has someone got an example somewhere? Is there instructions for doing this? In a sense what I am asking is how to display heirarchical object data in a flat grid.

This is an example of what I want to display

Task.User.UserName

Task.TaskDate

Task.Status.Description

Task.TaskNumber

etc.

Parents
  • 28464
    Verified Answer
    posted

    I found a related post here, that relates to binding a list of complex objects (objects with nested sub-objects) and how to display them in stock asp:gridview control, but I am pretty sure the same principles can be tried with UltraWebGrid. The technique revolves around using templated columns and using databinding expressions to map to the respective complex sub-property, e.g. <%# Eval("User.UserName") %>

    You just have to make sure you have public properties exposed for the properties you need to use. 

    More info can be found here: 

    http://www.velocityreviews.com/forums/t111794-bind-gridview-to-generic-custom-object-list-collection.html 

    Please, let me know if this helps. 

Reply Children