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

RadGrid NestedViewTemplate/DetailTables and Web Service Data-Binding

1 Answer 199 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Valery
Top achievements
Rank 2
Valery asked on 13 Dec 2009, 08:21 PM
Hello,

I've been playing around with RadGrid in a financial application that retrieves its data every second. In order to reduce server load I did some data caching and utilized RadGrid's client data-binding capabilities. Data is retrieved from an ASMX web service. Unfortunately I couldn't find a good demo implementing web server data-binding and NestedViewTemplate's/DetailTables'...

Consider a markup like this one:

        <telerik:RadGrid ID="Grid1" runat="server"
            <MasterTableView HierarchyLoadMode="ServerOnDemand"
                <Columns> 
                    <telerik:GridBoundColumn DataField="Date" HeaderText="Date" DataFormatString="{0:D}" /> 
                    <telerik:GridBoundColumn DataField="Source" HeaderText="Source" /> 
                    <telerik:GridBoundColumn DataField="Subject" HeaderText="Subject" /> 
                </Columns> 
                <NestedViewTemplate> 
                    <asp:Label ID="LblBody" runat="server" Text='<%# Bind("Body") %>' meta:localize="false" /> 
                </NestedViewTemplate> 
                <NestedViewSettings> 
                    <ParentTableRelation> 
                        <telerik:GridRelationFields MasterKeyField="NewsID" DetailKeyField="NewsID" /> 
                    </ParentTableRelation> 
                </NestedViewSettings> 
            </MasterTableView> 
            <ClientSettings> 
                <DataBinding Location="~/GridFeeder.asmx" SelectMethod="GetNews" SelectCountMethod="GetNewsCount" /> 
                <Selecting AllowRowSelect="True" /> 
            </ClientSettings> 
        </telerik:RadGrid> 

It would be nice if I could somehow attach a select method to the NestedViewTemplate in order to retrieve a news by NewsID and still use a web service for that.

I've got an almost identical issue with DetailTables - I can't set a web service method to retrieve the appropriate data filtered by NewsID.

I know I can achieve this by using ObjectDataSource but I can not (correct me if I am wrong) point it to an arbitrary web service.

Any help would be greatly appreciated.
Thank you.

1 Answer, 1 is accepted

Sort by
0
Accepted
Sebastian
Telerik team
answered on 14 Dec 2009, 08:16 AM
Hello Valery,

Since built-in hierarchy with client load and client-side binding is not supported in the present version of RadGrid for ASP.NET AJAX, you may consider one of the solutions presented in this blog post on our site. 

The first option is to use 'host' a second grid instance in the main grid and show detail records for the expanded item in the master dynamically, while the second presents how to display the information separately in master/detail fashion. Feel free to use the technique which is in conjunction with your schema.

Best regards,
Sebastian
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Valery
Top achievements
Rank 2
Answers by
Sebastian
Telerik team
Share this question
or