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

[Solved] ADO.NET Data Services question

1 Answer 141 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 16 Jun 2009, 05:34 PM
Hi,

I have two entities, User and ContactDetails which are modelled using the Entity Framework. A single "user" record maps to a single "ContactDetails" record.

What I want to do is list various fields from the User and Contact details and show them in the grid, as this is a 1:1 link I need to show them one a single grid line.

In DataServices I can do this efficiently using something along the lines of "http://server/DataService.svc/UsernameSet?$expand=ContactDetails" which will return me what I need. However I cannot see how to do this with the grid control as I can only specify a single table name in the client settings.

Regards,

Richard

 

 

   <telerik:RadGrid ID="RadGrid1" runat="server">  
      <MasterTableView> 
         <Columns> 
            <telerik:GridBoundColumn DataField="Id" HeaderText="ID" DataType="System.Int32"/>  
            <telerik:GridBoundColumn DataField="LoginId" HeaderText="Login Name" DataType="System.Int32"/>  
            <telerik:GridBoundColumn DataField="ContactDetails.FullName" HeaderText="Contact Name" DataType="System.String"/>  
         </Columns> 
      </MasterTableView> 
      <ClientSettings> 
         <DataBinding Location="DataService.svc" CountPropertyName="UsernameSetCount">  
            <DataService TableName="UsernameSet" /> 
         </DataBinding> 
      </ClientSettings> 
   </telerik:RadGrid> 


 

 

 

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 19 Jun 2009, 11:15 AM
Hello Richard ,

Generally you can add any View to your ADO.NET entity model that aggregates result from multiple tables and set that View for DataTable setting. For your convenience I am attaching sample application demonstrating this case.

Other option is to manually request the service with all necessary parameters as demonstrated on the following blog post:
 RadGrid Client Data Binding And ADO.Net DataServices example

Best wishes,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Richard
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or