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
135
Setting the UnboundField.BindingPath to a specific EntityCollection element
posted

Hi!

I am trying to customize the layout of xamDataGrid programmatically by creating custom FieldLayouts with a colection of UnboundFields.

 This approach works fine until i try to set the BindingPath property to an element of the System.Data.Objects.DataClasses.EntityCollection. This collection type does not support index-based iteration and provides the 'ElementAt' method to access specific elements.

I tried to set the binding as

1) UnboundField.BindingPath = new PropertyPath("[0].Value");

2) UnboundField.BindingPath = new PropertyPath("ElementAt(0).Value");

However none of this worked.

I alo tried a different approach - assigning values to cells in the InitializeRecord event. However this time the grid seemed to slow down and the cell value remained unchanged no matter what i did.

I would be most grateful if you could help me with the BindingPath issue.