I have a self-referencing hierarchical grid defined as follows:
Each item can have 0 or more children. When I reorder the columns, the root level entries (indicated as "Parent Col Val" below) are reordered, but the child column values (e.g., "Child Col Val") remain in the order in the grid defintion. For example, if I have the initial layout defined as:
I then reorder the columns. While the parent values reorder properly, the child ones do not.
This also occurs when I the saved grid settings are reloaded during Page_init (e.g., the parent items are ordered in the saved order, but the child columns are ordered as they're defined). Attached are screenshots showing the grid before and after the columns are reordered to better describe the behavior I'm experiencing.
Is this a bug w/ the grid? I would expect that self-referencing grids would automatically reorder the child tables as well. If this isn't a bug, what is required in order for the columns to be ordered properly?
<
telerik:RadGrid
ID
=
"grdNotes"
runat
=
"server"
OnColumnCreated
=
"grdNotes_ColumnCreated"
OnItemCreated
=
"grdNotes_ItemCreated"
OnItemDataBound
=
"grdNotes_ItemDataBound"
OnNeedDataSource
=
"grdNotes_NeedDataSource"
OnPreRender
=
"grdNotes_PreRender"
AutoGenerateColumns
=
"False"
SkinID
=
"HierarchicalGrid"
GridLines
=
"None"
AllowCustomPaging
=
"True"
ShowStatusBar
=
"True"
PageSize
=
"20"
EnableLinqExpressions
=
"False"
Width
=
"99%"
CellSpacing
=
"0"
>
<
MasterTableView
HierarchyDefaultExpanded
=
"true"
HierarchyLoadMode
=
"Client"
AllowSorting
=
"true"
DataKeyNames
=
"Id,ParentId,Token,IsRoot,Replies,NoteCreator"
ClientDataKeyNames
=
"Id,ParentId,Token,IsRoot,Replies,NoteCreator"
NoDetailRecordsText
=
""
EnableNoRecordsTemplate
=
"False"
TableLayout
=
"Auto"
Width
=
"100%"
HorizontalAlign
=
"Right"
EnableHeaderContextMenu
=
"True"
>
<
SelfHierarchySettings
ParentKeyName
=
"ParentId"
KeyName
=
"Id"
MaximumDepth
=
"20"
/>
<
RowIndicatorColumn
Visible
=
"False"
FilterControlAltText
=
"Filter RowIndicator column"
></
RowIndicatorColumn
>
<
ExpandCollapseColumn
Visible
=
"True"
FilterControlAltText
=
"Filter ExpandColumn column"
></
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridClientSelectColumn
DataTextField
=
"Id"
HeaderAbbr
=
"Select"
HeaderButtonType
=
"TextButton"
HeaderText
=
"Select"
HeaderTooltip
=
"Select/Deselect"
Text
=
"Select"
Visible
=
"false"
UniqueName
=
"asgSelect"
>
</
telerik:GridClientSelectColumn
>
<
telerik:GridBoundColumn
DataField
=
"Id"
SortExpression
=
"Id"
UniqueName
=
"Id"
>
<
HeaderStyle
Width
=
"50px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Title"
SortExpression
=
"Title"
UniqueName
=
"Title"
HtmlEncode
=
"true"
>
<
HeaderStyle
Width
=
"150px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Body"
SortExpression
=
"Body"
UniqueName
=
"Body"
HtmlEncode
=
"False"
>
<
HeaderStyle
Width
=
"350px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"CreatedBy"
SortExpression
=
"CreatedBy"
UniqueName
=
"CreatedBy"
>
<
HeaderStyle
Width
=
"150px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"CreatedDate"
SortExpression
=
"CreatedDate"
UniqueName
=
"CreatedOn"
>
<
HeaderStyle
Width
=
"150px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ParentId"
HeaderText
=
"Parent Id"
SortExpression
=
"ParentId"
UniqueName
=
"ParentId"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
DataField
=
"Token"
HeaderText
=
"Token"
SortExpression
=
"Token"
UniqueName
=
"Token"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
DataField
=
"IsRoot"
HeaderText
=
"Is Root"
SortExpression
=
"IsRoot"
UniqueName
=
"IsRoot"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
DataField
=
"Replies"
HeaderText
=
"Replies"
SortExpression
=
"Replies"
UniqueName
=
"Replies"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
DataField
=
"NoteCreator"
HeaderText
=
"NoteCreator"
SortExpression
=
"NoteCreator"
UniqueName
=
"NoteCreator"
Visible
=
"false"
/>
<
telerik:GridTemplateColumn
UniqueName
=
"Actions"
Visible
=
"false"
>
<
ItemTemplate
>
<
telerik:RadToolBar
ID
=
"rtbNoteActions"
runat
=
"server"
SkinID
=
"ActionToolbar"
OnButtonClick
=
"NotesGridToolbarButtonClicked"
OnClientButtonClicking
=
"NoteActionToolbarClicking"
>
<
Items
>
<
telerik:RadToolBarButton
Text
=
"Properties"
CommandName
=
"Properties"
ImageUrl
=
"~/Images/page_view.gif"
/>
<
telerik:RadToolBarButton
Text
=
"Reply"
CommandName
=
"Reply"
ImageUrl
=
"~/Images/page_edit.gif"
/>
<
telerik:RadToolBarButton
Text
=
"Security"
CommandName
=
"Security"
ImageUrl
=
"~/Images/shield16.gif"
/>
<
telerik:RadToolBarButton
Text
=
"Delete"
CommandName
=
"Delete"
ImageUrl
=
"~/Images/delete16.gif"
/>
</
Items
>
</
telerik:RadToolBar
>
</
ItemTemplate
>
<
HeaderStyle
Width
=
"15%"
></
HeaderStyle
>
</
telerik:GridTemplateColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
></
EditColumn
>
</
EditFormSettings
>
<
PagerStyle
AlwaysVisible
=
"True"
></
PagerStyle
>
</
MasterTableView
>
<
HeaderContextMenu
EnableTheming
=
"True"
>
<
CollapseAnimation
Type
=
"OutQuint"
Duration
=
"200"
></
CollapseAnimation
>
</
HeaderContextMenu
>
<
ExportSettings
ExportOnlyData
=
"True"
IgnorePaging
=
"True"
>
</
ExportSettings
>
<
ClientSettings
Selecting-AllowRowSelect
=
"true"
Resizing-AllowColumnResize
=
"true"
AllowColumnsReorder
=
"true"
>
<
Selecting
AllowRowSelect
=
"True"
></
Selecting
>
<
ClientEvents
OnRowSelected
=
"NoteRowSelected"
OnRowContextMenu
=
"NoteContextMenu"
OnRowDblClick
=
"grdNotes_OnRowDblClick"
OnGridCreated
=
"NotePageLoad"
OnTableCreated
=
"ResizeAllNoteColumns"
OnColumnResized
=
"ResizeAllNoteColumns"
OnColumnHiding
=
"HideDetailColumn"
OnColumnShowing
=
"ShowDetailColumn"
/>
</
ClientSettings
>
<
PagerStyle
Position
=
"Bottom"
AlwaysVisible
=
"True"
Mode
=
"NextPrevAndNumeric"
Wrap
=
"False"
BackColor
=
"White"
Font-Size
=
"Large"
/>
</
telerik:RadGrid
>
Each item can have 0 or more children. When I reorder the columns, the root level entries (indicated as "Parent Col Val" below) are reordered, but the child column values (e.g., "Child Col Val") remain in the order in the grid defintion. For example, if I have the initial layout defined as:
Col A | Col B | Col C
Parent A Val | Parent B Val | Parent C Val
Child A Val | Child B Val | Child C Val
Child A Val | Child B Val | Child C Val
Parent A Val | Parent B Val | Parent C Val
I then reorder the columns. While the parent values reorder properly, the child ones do not.
Col B | Col A | Col C
Parent B Val | Parent A Val | Parent C Val
Child A Val | Child B Val | Child C Val
Child A Val | Child B Val | Child C Val
Parent B Val | Parent A Val | Parent C Val
This also occurs when I the saved grid settings are reloaded during Page_init (e.g., the parent items are ordered in the saved order, but the child columns are ordered as they're defined). Attached are screenshots showing the grid before and after the columns are reordered to better describe the behavior I'm experiencing.
Is this a bug w/ the grid? I would expect that self-referencing grids would automatically reorder the child tables as well. If this isn't a bug, what is required in order for the columns to be ordered properly?