This example shows how to create a new custom View that will include data from two dependent data tables.
Let's assume you need to show the Orders table content in DXGrid using the RiaInstantFeedbackDataSource. The Order entity has the CustomerID field and you may wish to display information about order's customer within the grid. For example, show the customer's name from the Customers table along with the CustomerID.
The easiest way to accomplish this task is to create a new View in the database that will include data from both the Orders and Customer tables. This can be done on the server side using the following SQL script:
[SQL]CREATE VIEW [dbo].[CustomerOrders] AS SELECT OrderID, CompanyName, ContactName, OrderDate FROM Orders inner join Customers on Orders.CustomerID = Customers.CustomerID
Now, when the new View is ready, you'll need to create an ADO.Net Entity Data Model based on this custom view and create a Domain Service based on this model. The required steps are similar to those shown in the 'How to: Use DXGrid with RIA Services' help topic. The only difference is that it is necessary to choose the new custom View in the 'Choose Your Data Base Object' data model wizard's dialog rather than Orders table.
As a result, a model with the following diagram will be created:
An alternative approach is to use the extended data query and join data from two tables within the Domain Service GetCustomerOrders method. Please refer to the RiaInstantFeedbackDataSource - How to show included entity field data in DXGrid using the extended data query example to see this approach in action.
Question Comments
Added By: rasool jalali at: 5/19/2015 7:25:09 AM
Hi dear
I want to use RiaInstantFeedbackDataSource in my silverligt project but this not exist in xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
or DevExpress.Xpf.Core.ServerMode namespace.
Where is my mistake ?
Please help me