This is a migrated thread and some comments may be shown as answers.

Multiple Entities with Include

1 Answer 73 Views
DomainDataSource
This is a migrated thread and some comments may be shown as answers.
Jeff Waddell
Top achievements
Rank 1
Jeff Waddell asked on 20 Apr 2011, 04:42 PM
Can the Domain Data Source work with multiple entities returned from a query using include?

How would you bind two grids to a single domain source and specify the entity collections they should bind to?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 20 Apr 2011, 05:04 PM
Hello Jeff Waddell,

You can't do that in the way you describe it. Don't use Include because it will fetch more data than needed.

If you have two RadDomainDataSources one can display the master entities and the other the detail ones. The one for the detail entities can have a QueryParameter which will accept the master entity ID and fetch only the relevant child entities from the server. Then you can somehow bind the Value of this QueryParameter to the SelectedItem of the master grid or its ID or whatever is the primary key. In this way, each time the user selects a different row from the master grid, the binding will trigger, the QueryParameter.Value of the details RDDS will change and if it is AutoLoad it will go to the server and take all the relevant child records.

You will have two grids with master-details relationship both pulling data from the server.

Here is my series of blog posts, which you might find interesting:

I hope this helps. Let me know if there are problems.

Regards,
Ross
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
DomainDataSource
Asked by
Jeff Waddell
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or