RadGrid NestedViewTemplate/DetailTables and Web Service Data-Binding

2 posts, 1 answers
  1. Valery
    Valery avatar
    45 posts
    Member since:
    Nov 2008

    Posted 13 Dec 2009 Link to this post


    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"
                        <telerik:GridBoundColumn DataField="Date" HeaderText="Date" DataFormatString="{0:D}" /> 
                        <telerik:GridBoundColumn DataField="Source" HeaderText="Source" /> 
                        <telerik:GridBoundColumn DataField="Subject" HeaderText="Subject" /> 
                        <asp:Label ID="LblBody" runat="server" Text='<%# Bind("Body") %>' meta:localize="false" /> 
                            <telerik:GridRelationFields MasterKeyField="NewsID" DetailKeyField="NewsID" /> 
                    <DataBinding Location="~/GridFeeder.asmx" SelectMethod="GetNews" SelectCountMethod="GetNewsCount" /> 
                    <Selecting AllowRowSelect="True" /> 

    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.
  2. Answer
    Sebastian avatar
    9934 posts

    Posted 14 Dec 2009 Link to this post

    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,
    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.
  3. DevCraft R3 2016 release webinar banner
Back to Top