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

Problem in grid Hierarchy

0 Answers 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike_T
Top achievements
Rank 1
Mike_T asked on 11 Sep 2012, 07:41 PM
Hi guys,

I have a problem in displaying the data from an sql table in an hierarchic way, as you can see in the screenshot (http://agileprecis.com/db-diagram.jpg), the table tasks will contain endless sub tasks for each task and it's using the referewnce ParentTaskID.

The problem in the grid display is it is displaying the subTasks as a normal row, wil it shouldn't appear unless i expand the specific node.

below is the code i'm using:
<telerik:RadGrid ID="DataGrid" runat="server" ShowStatusBar="True" AllowFilteringByColumn="True"                    AllowAutomaticUpdates="false" Width="100%" AllowAutomaticInserts="false" AllowAutomaticDeletes="false"
AllowPaging="True" PageSize="7" ShowGroupPanel="True">
<MasterTableView AutoGenerateColumns="False" AllowSorting="true" CommandItemDisplay="Top"
AllowAutomaticUpdates="false" AllowAutomaticInserts="false" AllowAutomaticDeletes="false"
HierarchyDefaultExpanded="false" HierarchyLoadMode="Client" DataKeyNames="TaskID, ParentTaskID" Width="100%">
                                                                
<SelfHierarchySettings ParentKeyName="ParentTaskID" KeyName="TaskID" />
<HeaderStyle HorizontalAlign="Center" /><FilterItemStyle HorizontalAlign="Center" />
<NoRecordsTemplate>No Records Found.</NoRecordsTemplate>
<Columns>
<telerik:GridButtonColumn UniqueName="Edit" CommandName="Edit" ButtonType="ImageButton"
 ImageUrl="~/Styles/images/icon_edit.gif" Text="Edit" HeaderText="Edit">
<HeaderStyle Width="35px" HorizontalAlign="center" />
 </telerik:GridButtonColumn>
 
<telerik:GridBoundColumn DataField="TaskID" Visible="True" HeaderText="TaskID" ReadOnly="True"
SortExpression="TaskID" UniqueName="TaskID"></telerik:GridBoundColumn>
                                                                     
<telerik:GridBoundColumn DataField="TaskTitle" HeaderText="TaskTitle" SortExpression="TaskTitle"
UniqueName="TaskTitle"> </telerik:GridBoundColumn>
                                                                     
<telerik:GridBoundColumn DataField="ParentTaskID" HeaderText="ParentTaskID" SortExpression="ParentTaskID"
Visible="True" UniqueName="ParentTaskID"> </telerik:GridBoundColumn>
                                                                 
</Columns>
</MasterTableView>
</telerik:RadGrid>

Thanks for your support

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Mike_T
Top achievements
Rank 1
Share this question
or