I'm using entity framework classes as my datasource
The class is OrderDetail which have these properties:ID (int) Item(Class Item)Quantity (int)Subtotal (decimal)
Class Item has these propertiesID (int)Name (string)
So i set the xamDataGrid.Datasource = List(of OrderDetail)
I want to show the columns: Item.Name, Quantity, and Subtotal
So I specified 3 fields. I'm having problem setting the Field Name for Item.Name. "Item.Name" doesn't work, if I use that I get a blank grid.
Is this at all possible? I can easily bind "Item.Name" within a ListBox DataTemplate, how do I this with xamDataGrid.
Thank you
Hello Kevin,
UnboundFields area created just like normal fields.
UnboundFields field = new UnboundField();
The Difference is that you have to set the BindingPath property and set the desired binding:
field.BindingPath= new PropertyPath(...);
Here is the updated link of how to use unbound fields.
Hope this helps.
Hello -
any idea where these sample pages went? I have the same situation and have no idea how to create an unbound column. i'm using 9.1.
thanks
Kevin
Hi,
A Field object cannot bind to nested/complex properties. In order to bind to nested/complex properties, you need to add an UnboundField object to your Fields collection. For an example, you can click on a link below:
An example in XAML
An example in C#/VB.NET
Hope that helps. :)