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
2387
Data binding to the property of a property
posted

I am filling a UltraWinGrid with a collection of Person Objects:

class Orders
{
// details
}

class Person
{
    public string Name;
    public BindingList<Orders> orders;
}

I would like to display the the customer's name and the number of orders in the UltraWinGrid.  How do I go about doing that?

 

Sam

  • 37774
    Suggested Answer
    posted

    Sam,

    The easiest way would be to simply add a property to the person class that returns the length/count of the items in the BindingList, which the grid should then pick up from the BindingManager.  If that isn't an option, then you could add an unbound column to the grid and in the InitializeRow event, set the value of the cell in that column to the number of child rows (i.e. row.ChildBands[0].Rows.Count).

    -Matt