Hello,
I have followed this example to build a SelfHierarchy RadGrid:
http://www.telerik.com/help/aspnet/grid/grdselfreferencinghierarchy.html
and it went well, except for the filters.
What's happening is that when I add a filter condition it displays the root item and the child items as it should and then again child items as if they were root items.
Here is the aspx code of the grid:
Best regards,
Tomaž Lovrec
I have followed this example to build a SelfHierarchy RadGrid:
http://www.telerik.com/help/aspnet/grid/grdselfreferencinghierarchy.html
and it went well, except for the filters.
What's happening is that when I add a filter condition it displays the root item and the child items as it should and then again child items as if they were root items.
Here is the aspx code of the grid:
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlTask" OnColumnCreated="RadGrid1_ColumnCreated" |
OnItemCreated="RadGrid1_ItemCreated" OnInsertCommand="taskInsertCommand" OnItemCommand="RadGrid1_ItemCommand" |
OnUpdateCommand="taskUpdateCommand" OnDeleteCommand="taskDeleteCommand" |
OnItemDataBound="RadGrid1_ItemDataBound" GridLines="None" Skin="Sunset" Width="100%"> |
<MasterTableView HierarchyDefaultExpanded="true" HierarchyLoadMode="ServerBind" AllowSorting="true" AllowFilteringByColumn="true" |
DataKeyNames="id, deadline, percent_complete, id_prioritete" Width="100%" AutoGenerateColumns="False" |
DataSourceID="SqlTask" GridLines="None" AllowPaging="False" EditMode="PopUp"> |
<SelfHierarchySettings ParentKeyName="id_parent" KeyName="id" /> |
<Columns> |
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Preview" Text="Predogled" ImageUrl="~/members/images/magnifier.png" UniqueName="Preview"> |
<HeaderStyle Width="25px" /> |
</telerik:GridButtonColumn> |
<telerik:GridEditCommandColumn ButtonType="ImageButton" CancelText="Preklici" |
InsertText="Dodaj" UpdateText="Shrani"> |
<HeaderStyle Width="32px" /> |
</telerik:GridEditCommandColumn> |
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" |
ConfirmDialogType="RadWindow" ConfirmText="Ali si preprican da želiš izbrisati vnos?" |
Text="Briši" UniqueName="column"> |
<HeaderStyle Width="32px" /> |
</telerik:GridButtonColumn> |
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="StartTask" Text="Začni z nalogo" |
UniqueName="StartTask" ImageUrl="~/members/images/calendar.gif"> |
<HeaderStyle Width="25px" /> |
</telerik:GridButtonColumn> |
<telerik:GridBoundColumn HeaderText="P" ReadOnly="true" UniqueName="priority" AllowFiltering="false" HeaderStyle-Width="25px" DataField="priority"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn HeaderText="P" ReadOnly="true" UniqueName="id_prioritete" |
AllowFiltering="false" HeaderStyle-Width="25px" DataField="id_prioritete" Visible="false"> |
</telerik:GridBoundColumn> |
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="EndTask" Text="Končaj nalogo" |
UniqueName="EndTask" ImageUrl="~/members/images/cancel.gif"> |
<HeaderStyle Width="25px" /> |
</telerik:GridButtonColumn> |
<telerik:GridBoundColumn DataField="id" DataType="System.Int32" HeaderText="ID" |
ReadOnly="True" SortExpression="id" UniqueName="id" Visible="false"> |
<HeaderStyle Width="200px" /> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="title" DataType="System.String" |
HeaderText="NASLOV" SortExpression="title" |
UniqueName="title" HeaderStyle-Width="150px"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="start_date" DataType="System.DateTime" |
HeaderText="DATUM ZAČETKA" SortExpression="start_date" UniqueName="start_date" HeaderStyle-Width="150px"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="task_creator" DataType="System.Guid" |
HeaderText="USTVARJALEC" SortExpression="task_creator" |
UniqueName="task_creator" HeaderStyle-Width="150px"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="task_assigned" DataType="System.Guid" |
HeaderText="IZVAJALEC" SortExpression="task_assigned" |
UniqueName="task_assigned" HeaderStyle-Width="150px"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="deadline" DataType="System.DateTime" |
HeaderText="ROK" SortExpression="deadline" UniqueName="deadline" HeaderStyle-Width="150px"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="percent_complete" DataType="System.Int32" |
HeaderText="KONČANO V %" SortExpression="percent_complete" |
UniqueName="percent_complete" HeaderStyle-Width="150px"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="end_date" DataType="System.DateTime" |
HeaderText="DATUM KONCA" SortExpression="end_date" UniqueName="end_date" HeaderStyle-Width="150px"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="predecessors" HeaderText="PREDHODNIKI" |
SortExpression="predecessors" UniqueName="predecessors" HeaderStyle-Width="150px"> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="id_parent" DataType="System.Int32" |
HeaderText="id_parent" SortExpression="id_parent" UniqueName="id_parent" Visible="false" HeaderStyle-Width="150px"> |
</telerik:GridBoundColumn> |
</Columns> |
<EditFormSettings CaptionFormatString="UREJANJE NALOG" UserControlName="user_controls/insertTask.ascx" |
EditFormType="WebUserControl" PopUpSettings-Width="600"> |
<EditColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1"> |
</EditColumn> |
<PopUpSettings ScrollBars="None"></PopUpSettings> |
</EditFormSettings> |
</MasterTableView> |
<ClientSettings AllowExpandCollapse="true" /> |
</telerik:RadGrid> |
Best regards,
Tomaž Lovrec