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

[Solved] Self-referencing hierarchical grid not finding children

1 Answer 101 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bruce
Top achievements
Rank 1
Bruce asked on 14 Aug 2013, 07:30 PM
I am trying to build a grid that self-references orders on a Guid ID. Ultimately I want the user to be able to click on a button and turn the self-referencing on and off, but currently I am just working on the self-referencing part. The grid data source is a nettiers TList<order>. The grid shows a hierarchical structure, but the single related order in my test data is shown only as a top level item. The order it should be related to only shows "No child records to display." The search function returns the correct results, and the grid displays the correct results, but the parent and child are not linked. I have double checked that the data IDs are correct.

From the .aspx file
<telerik:RadGrid ID="uxOrderListControl" runat="server"
    OnNeedDataSource="uxOrderListControl_NeedDataSource"
    OnItemCreated="uxOrderListControl_ItemCreated"
    OnColumnCreated="uxOrderListControl_ColumnCreated"
    Width="100%"
    OnItemDataBound="uxOrderListControl_ItemDataBound"
    AutoGenerateColumns="False"
    ClientSettings-Selecting-AllowRowSelect="true"
    AllowMultiRowSelection="true"
    ParentDataKeyNames="ReferralInvoiceId"
    DataKeyNames="OrderId"
    EnableLinqExpressions="false"
    MasterTableView-HierarchyDefaultExpanded="true"
    MasterTableView-HierarchyLoadMode="ServerBind">
    <MasterTableView AllowSorting="true" DataKeyNames="OrderId, ReferralInvoiceId">
        <SelfHierarchySettings ParentKeyName="ReferralInvoiceId" KeyName="OrderId" />
    </MasterTableView>
    <ClientSettings AllowExpandCollapse="true">
        <Selecting AllowRowSelect="True"></Selecting>
        <ClientEvents OnDataBound="uxOrderListControl_OnDataBound" />
    </ClientSettings>
</telerik:RadGrid>
From the code behind file. (run on a Search button click event)
... code to fill parameters and call a search method
 
uxOrderListControl.DataSource = orderList;
uxOrderListControl.DataBind();

1 Answer, 1 is accepted

Sort by
0
Bruce
Top achievements
Rank 1
answered on 16 Aug 2013, 07:21 PM
It turns out the a self-referencing hierarchical grid is not compatible with a nettiers TList. I converted the TList to a standard list and the self-referencing is working now.
Tags
Grid
Asked by
Bruce
Top achievements
Rank 1
Answers by
Bruce
Top achievements
Rank 1
Share this question
or