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

Hierarchy Grid and ObjectDataSource

2 Answers 19 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 04 Oct 2013, 03:49 AM
I created a Hierarchy grid in my page with object data sources.. calling some static methods in the code behind..
When i run the code.. i see the little arrow indicating the rows are expandable.. but when i click on it .. it wont expands..
I did see the call being made to the selectmethod in ods2 (see below) with the proper parentid value..
(select method prototype is .. List<...> SelectDataForODS2(int ParentId) {} ).. there was even values returned .. but the rows wont expand.

What am i missing?

<telerik:RadGrid ID="....... DataSourceID="ods1">
<MasterTableView AutoGenerateColumns="False" DataSourceID="ods1" DataKeyNames="parentid"
                            EditMode="EditForms" AllowFilteringByColumn="False" AllowMultiColumnSorting="True">
            <DetailTables>
                                <telerik:GridTableView Name="..." runat="server" AutoGenerateColumns="False"
                                    DataKeyNames="childid" DataSourceID="ods2" Width="100%">
                                    <ParentTableRelation>
                                        <telerik:GridRelationFields DetailKeyField="parentid"
                                            MasterKeyField="parentid" />
                                    </ParentTableRelation>
                                    <Columns>........
........................................


2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 04 Oct 2013, 06:58 AM
HI Chris,

Please try the sample code snippet.If this doesn't help,please provide your full code snippet.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" DataSourceID="ObjectDataSource1"
    GridLines="None" AllowPaging="true">
    <MasterTableView DataKeyNames="ID" HierarchyLoadMode="Client"Name="Parent">
        <Columns>
            <telerik:GridBoundColumn UniqueName="Name" DataField="Name" HeaderText="Name" />
            <telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="ID" />
        </Columns>
        <DetailTables>
            <telerik:GridTableView Name="Child" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
                Width="100%" DataSourceID="ObjectDataSource2" HierarchyLoadMode="Client">
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="ID" MasterKeyField="ID" />
                </ParentTableRelation>
                <Columns>
                    <telerik:GridBoundColumn UniqueName="TimeType" DataField="TimeType" HeaderText="TimeType" />
                    <telerik:GridBoundColumn DataField="Discontinued" HeaderText="Discontinued" UniqueName="Discontinued" />
                </Columns>
            </telerik:GridTableView>
        </DetailTables>
    </MasterTableView>
    <ClientSettings AllowExpandCollapse="true">
    </ClientSettings>
</telerik:RadGrid>

Thanks,
Princy
0
Chris
Top achievements
Rank 1
answered on 04 Oct 2013, 03:55 PM
Thank you..
The simple page works... if i add all my logic into it .. i wont work.. will work on it and let u kow.. thanks again
Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Chris
Top achievements
Rank 1
Share this question
or