Hi,
Is it possible to have a self-referencing hierarchy grid and bind the nested rows server side?
I was guessing that I should use ItemCommand event and check for ExpandCollapse argument but I cant figure out how to add the table structure to the grid then.
Maybe it's not exactly an self referencing grid I'm after, the important thing is to bind every level server side because it's a lot of levels and total number of rows.
Is this possible?
Regards,
Mattias
Is it possible to have a self-referencing hierarchy grid and bind the nested rows server side?
| <telerik:RadGrid ID="radGridUnits" runat="server" AllowPaging="false" Width="100%" |
| AllowSorting="false" AutoGenerateColumns="false" GridLines="Both" CssClass="selfHierarchyTable" |
| oninsertcommand="radGridUnits_InsertCommand" |
| onupdatecommand="radGridUnits_UpdateCommand" |
| ondeletecommand="radGridUnits_DeleteCommand" |
| onitemdatabound="radGridUnits_ItemDataBound" |
| onneeddatasource="radGridUnits_NeedDataSource" |
| OnItemCreated="radGridUnits_ItemCreated" |
| OnColumnCreated="radGridUnits_ColumnCreated" |
| Skin="Default" onitemcommand="radGridUnits_ItemCommand"> |
| <mastertableview commanditemdisplay="Top" datakeynames="ID, ParentID" |
| HierarchyLoadMode="ServerOnDemand" |
| editmode="EditForms" name="Master" Width="100%" |
| nomasterrecordstext="<%$ Resources:resources,Msg_NoUnits %>" |
| tablelayout="Fixed"> |
| <SelfHierarchySettings ParentKeyName="ParentID" KeyName="ID" /> |
| <commanditemsettings addnewrecordtext="<%$ Resources:resources,Grid_AddUnit %>" refreshtext="<%$ Resources:resources,Grid_Refresh %>" /> |
| <Columns> |
| <telerik:GridTemplateColumn UniqueName="Name2" HeaderText="<%$ Resources:resources,Label_Name %>"> |
| <ItemTemplate> |
| <asp:Button ID="MyExpandCollapseButton" runat="server" CommandName="ExpandCollapse" OnClick="button_Click"></asp:Button> |
| <asp:Label ID="labelName" runat="server" Text='<%# Eval("Name") %>'></asp:Label> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
I was guessing that I should use ItemCommand event and check for ExpandCollapse argument but I cant figure out how to add the table structure to the grid then.
Maybe it's not exactly an self referencing grid I'm after, the important thing is to bind every level server side because it's a lot of levels and total number of rows.
Is this possible?
Regards,
Mattias