My grid is bound to a list of Payment objects. Each Payment object has a few properties including a List of PaymentDetail objects. I'd like to display some properties from the Payment object along with some properties of the PaymentDetail object, while displaying only one line per PaymentDetail with the Payment object data repeated (rather than displaying hierarchically. Basically like the results I would get from a SQL join.
Is that possible, or do I need to flatten my data before I display it?
UnboundFields support the use of indexers in the binding path, so you could bind to ParentProperty.SubCollection[X].SubPropertyName. However, you would have to know the size of sub items collection when creating the UnboundFields.
That works if I have a 1:1 relationship between the parent object and the child. But it doesn't work if I have a 1:* relationship between parent and child. If I bind the grid to a list of Payment objects as defined below, I can't seem to bind to PaymentID and PaymentDetailID on the same row in the grid.
public class Payment
{
public int PaymentID {get; set;}
public List<PaymentDetail> PaymetnDetails {get; set;}
}
public class PaymentDetail
public int PaymentDetailID {get; set;}
Hello,You do not need to flatten your data to display a nested property. Please follow this link in our help on how to display a complex property using Unbound Fields.