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

Hierarchy from EF Entities returned by a Single SP call which returns Multiple ResultSets ?

1 Answer 73 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bernd Wessels
Top achievements
Rank 1
Bernd Wessels asked on 09 Sep 2010, 12:35 AM
Hi
hopefully the title of this post is not to confusing. Here is what I want to do:

I have a single stored procedure which returns "Customers" as the first result set and "Orders" as the second result set and "OrderDetails" as the third result set.

I use the Entity Framework Extensions to get the returned Entities into a single ObjectContext.

This works fine - I used it many times with Silverlight and WCF - all the entities and relations are materialized just fine.

This means, with a single call to a "highly specific optimized magic" Stored Procedure I get all the "master" entities and their related "child" entities at once. Good for the server, good for me, good for the environment ;)

Now what I want to do is:

Show the "master" entities and the related "child" entities in a hierarchical ASP.NET AJAX RadGrid.

What I don't know yet:

How to do it ;)
[The EntityDataSource does not work in this scenario, I guess.]

How to avoid multiple trips between the server and the client using hierarchical entities from a single context.
[There is no example or documentation covering this.]


Summary:

How to show Master-Detail "Entity Framework" Entities in a hierarchical RadGrid that come from a single call to a Stored Procedure ?

How to avoid multiple client calls to the server to fill the hierarchy from the Entities in the ObjectContext into the RadGrid ?

How would you solve this using OpenAccess ORM instead of the Entity Framework - Keeping in mind that all the data is returned from a single stored procedure call which returns the complete hierarchy in multiple result sets at once?


Cheers

Bernd

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 14 Sep 2010, 11:29 AM
Hello Bernd,

Regarding your first question:

Currently the RadGrid does not support the desired functionality. The only hierarchy which could be created from a single call to the server is auto generated hierarchy from DataSet. You could see the demo of it on the following link:
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/autogeneratedhierarchy/defaultcs.aspx

Additionally we have plans for implementing auto generated hierarchy created from EF objects and our developers are working on it. If it is achievable you may see it in some of the next releases of our controls. However we do not commit specific time for a features.

With respect to your second question:
With the current implementation of the RadGrid you could avoid multiple client calls to the server to fill the hierarchy only when the RadGrid.MasterTableView.HierarchyLoadMode property is set to Client. However to build the hierarchy you need to use the Declarative Relations or programmatic data binding using DetailsTableDataBind event.

Regarding your last question:
If we implement the functionality for building the auto generated hierarchy from EF object, the RadGrid will support building the auto generated hierarchy from OpenAccess object too.

I hope this help.

Regards,
Radoslav
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
Grid
Asked by
Bernd Wessels
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or