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
140
Binding and child bands in xamgrid
posted

Hi, i have a simple model with a list of Customer, each Customer has a property with a list of Order objects.
I have a Silverlight XamGrid, where the base band  has associated the list of Customers, and the child band has associated the list of Orders.

To bind the base band i have the next code:

this.xamGrid1.SetBinding(XamGrid.ItemsSourceProperty, () => mainPageViewModel.Customers);

this code works very well.

Now, to binding the child band i would like to have, for example:

this.xamGrid1.ColumnLayouts["Orders"].SetBinding(XamGrid.ItemSourceProperty, (Customer c) => c.Orders);

but the ColumnLayout doesn't have any method or property to set a different binding to the xamGrid.

How can i do this? Anybody can tell me some solution?

 

Thanks.

Parents
No Data
Reply
  • 8421
    posted

    By default you shouldn't need to set up a binding for the ColumnLayout. As long as each Customer exposes a property that is a collection of Order objects and the Key of the ColumnLayout is set to the name of that property then this should be handled automatically. Do you have a sample that I could look at?

Children
No Data