Binding parent and child data into DataGrid in ria services for silverlight 4 -


I started learning Silverlight 4 RIA services. I went from a lot of data bind patterns in a grid I am But there is no substance in spite of any obstacle.

There is a table for employees in my DB and there is a table for city names (PK with ID area). In an employee table, an FK has been brought to the CID field.

What I tried to do, was trying to show the name of the staff and their city. This is the usual way I showed up in all the tutorials (create admx, create domain services and using data source window to create datagrid)

The problems started when I started the city name Tried to force

& lt; Sdk: DataGridTextColumn x: name = "cityCodeColumn" binding

This employee works well:

= "{Binding Path = Citcode}" Header = "Citcode" width = "SizeTowder "/>

This line is not:

& lt; Sdk: DataGridTextColumn x: name = "cityNameColumn" binding = "{binding path = citytype.name}" header = "cityname" width = "ruler" />

After reading some more, I have realized that the Domain Service does not provide data of the organization selected by the LINQ command only, and does not exceed the information of child organizations

< P> So my question is, is there a pattern of making a silverlight application in which all the organizations between the entities involved are signed?

Thank you, Oren

City information is available upon compelling your employee records To make it happen, you will need to make sure that you include a City Reference attribute in your RIA Domain Services Metadata [Include].

You must also include references in your query.

  var result = this.ObjectContext.MyTestObject.Include (Foo);  

Hope it helps.


Comments