Only One Hierarchical grid will display data

5 posts, 0 answers
  1. Michael
    Michael avatar
    19 posts
    Member since:
    Oct 2008

    Posted 28 Jan 2009 Link to this post

    I have a setup like this:

    <telerik:RadGrid ID="invoiceListGrid" runat="server" GridLines="None" Skin="Default2006"
    AutoGenerateColumns
    ="False" OnNeedDataSource="invoiceListGrid_NeedDataSource"
    AllowFilteringByColumn
    ="True"  AllowPaging="True" AllowSorting="False"
    Width
    ="100%" OnItemCommand="invoiceListGrid_ItemCommand"
    AllowMultiRowSelection
    ="True" ShowStatusBar="true"
     
    <MasterTableView DataKeyNames="BillByPeriodID,LeaseID,YPID" PageSize="50" HierarchyLoadMode="Client"
     
    <DetailTables> 
    <telerik:GridTableView AllowSorting="false" AllowFilteringByColumn="false"
    DataKeyNames
    ="BillByPeriodID" DataSourceID="odsInvoiceDetails" Width="100%"
    <ParentTableRelation> 
    <telerik:GridRelationFields DetailKeyField="BillByPeriodID" MasterKeyField="BillByPeriodID" /> 
    </ParentTableRelation> 
    <Columns>...</Columns> 
    </telerik:GridTableView> 
     
    <telerik:GridTableView AllowSorting="false" AllowFilteringByColumn="false"
    DataKeyNames
    ="LeaseID,YPID" DataSourceID="odsOtherDetails" Width="100%"
    <ParentTableRelation> 
    <telerik:GridRelationFields DetailKeyField="LeaseID" MasterKeyField="LeaseID" /> 
    <telerik:GridRelationFields DetailKeyField="YPID" MasterKeyField="YPID" /> 
    <Columns>...</Columns> 
    </telerik:GridTableView> 
                             
    </DetailTables> 
     
    </MasterTableView> 
     
    <ClientSettings AllowExpandCollapse="True"
    </ClientSettings> 
     
    </telerik:RadGrid> 
     
    <asp:ObjectDataSource ID="odsInvoiceDetails" runat="server"  
    TypeName="Blah.BLL.Invoice"  
    SelectMethod="GetInvoiceByID"
    <SelectParameters> 
    <asp:SessionParameter Name="invoiceID" sessionField="BillByPeriodID" Type="Int32" Direction="input" /> 
    </SelectParameters> 
    </asp:ObjectDataSource> 
                 
    <asp:ObjectDataSource ID="odsOtherDetails" runat="server"  
    TypeName="Blah.BLL.Other"  
    SelectMethod="GetPeriodSummaryByLeaseID"
    <SelectParameters> 
    <asp:SessionParameter Name="leaseID" sessionField="LeaseID" Type="Int32" Direction="input" /> 
    <asp:SessionParameter Name="ypId" sessionField="YPID" Type="Int32" Direction="input" /> 
    </SelectParameters> 
    </asp:ObjectDataSource> 

    My problem is that only the first sub-grid shows any data.  In fact, the second sub-grid never even fires the SelectMethod of the ObjectDataSource to which it has been assigned.  This has been confirmed by placing a breakpoint in business class "Blah.BLL.Other".

    Why is my first sub-grid being loaded with data as expected, and the second (same level -- level 2) is being ignored?

    Thanks,

    Mike
  2. Michael
    Michael avatar
    19 posts
    Member since:
    Oct 2008

    Posted 28 Jan 2009 Link to this post

    Could this be related to the fact that in my master table I am using the NeedDataSource event to bind data in the codebehind, but with my sub-grids I am declaritively assigning the datasource using the DataSourceID property?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 29 Jan 2009 Link to this post

    Hi Michael,

    I have found the following forum link which explains how to implement Hierarchical Grid with ObjectDataSource. You may give a try with sample application provided by telerik and see if it helps to some extent.
    RadGrid Hierarchy with an objectdatasource

    Shinu
  5. Michael
    Michael avatar
    19 posts
    Member since:
    Oct 2008

    Posted 29 Jan 2009 Link to this post

    Hi Shinu,

    Thanks for the lead, but the example you reference is no different from my example but for two possible differences:

    1. The example uses a declarative ODS for the master table and I bind at runtime programatically.  I am having no problems with returning and displaying records from this master table.  In fact, I am having no problem getting records from the first child grid.
    2. The example uses "autogeneratecolumns=true" for all the tables.  I cannot do this.  But,  iahve tried it on the problem table (the second of the two children) and, interestingly, instead of getting nothing I got data from the master table!

    I am obviously missing something obvious here as no one else seems to complain of this issue.

    Thanks.
  6. Michael
    Michael avatar
    19 posts
    Member since:
    Oct 2008

    Posted 04 Feb 2009 Link to this post

    Bump
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017