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
40
xamGrid binding path
posted

Sorry if this has been asked before, but I can't seem to find an answer to this question.

I'm currently using Silverlight to populate a xamGrid using WCF RIA Services and the Entity Framework.

The data I'm binding to is not flat in structure, i.e. I have a collection of entities that include other related entities.

My problem is when I bind the itemsSource for the xamGrid, the standard text columns seem to expect a flat data source

(i.e. I can only specify a "Key" property that points to a property that is directly on my ItemsSource entities).

I cannot seem to bind to a subproperty.

 

Ex: I have a "Car" Entity that contains several "Wheel" Entities.

How do I display properties from the Car and Wheel entities in a single row in the grid ?

With the regular silverlight datagrid, I can specify the column binding as :

 

<sdk:DataGridTextColumn Header="Car Make"       

Binding="{Binding Path=Car.Make}"       /> 

 

<sdk:DataGridTextColumn Header="Wheel Size"      

Binding="{Binding Path=Wheel.Size}"       />

 

I guess my question is "is there a way to specify a binding path to a sub-property using the xamGrid ?"

 

 

-Nadim

 

Parents Reply Children
No Data