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

Error while changing position of column with column groups

4 Answers 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shridhar
Top achievements
Rank 1
Shridhar asked on 14 Nov 2019, 09:15 PM

Hi,

I have a grid which has column groups, I am trying to change the position of a column on runtime on click of a button but it gives me error.

Below is my code. I have read at few places that its not possible, is there any alternate way to achieve it.

<ColumnGroups><br>                        <telerik:GridColumnGroup HeaderText="Group 1" Name="Group1"></telerik:GridColumnGroup><br>                        <telerik:GridColumnGroup HeaderText="Group 2" Name="Group2"></telerik:GridColumnGroup><br>                    </ColumnGroups><br>                    <ColumnGroups><br>                        <telerik:GridColumnGroup HeaderText="Group 4" Name="Group3" ParentGroupName="Group1"></telerik:GridColumnGroup><br>                        <telerik:GridColumnGroup HeaderText="Group 5" Name="Group4" ParentGroupName="Group1"></telerik:GridColumnGroup><br>                        <telerik:GridColumnGroup HeaderText="Group 6" Name="Group5" ParentGroupName="Group2"></telerik:GridColumnGroup><br>                    </ColumnGroups><br>                    <Columns><br>                        <telerik:GridBoundColumn HeaderText="PO Date"  ></telerik:GridBoundColumn><br>                        <telerik:GridBoundColumn HeaderText="Submittal Package" ></telerik:GridBoundColumn><br>                        <telerik:GridBoundColumn HeaderText="Returned Submittals" ColumnGroupName="Group3" ></telerik:GridBoundColumn><br>                        <telerik:GridBoundColumn HeaderText="Release Date" ColumnGroupName="Group3"></telerik:GridBoundColumn><br>                        <telerik:GridBoundColumn HeaderText="Confirmation Dwgs" ColumnGroupName="Group3"></telerik:GridBoundColumn><br>                        <telerik:GridBoundColumn HeaderText="Construction Dwgs" ColumnGroupName="Group4"></telerik:GridBoundColumn><br>                        <telerik:GridBoundColumn HeaderText="Inspect/Witness Test" ColumnGroupName="Group4"></telerik:GridBoundColumn><br>                        <telerik:GridBoundColumn HeaderText="Shipment" ColumnGroupName="Group5"></telerik:GridBoundColumn><br>                        <telerik:GridBoundColumn HeaderText="Weeks PO-Ship" ColumnGroupName="Group5"></telerik:GridBoundColumn><br>                        <telerik:GridBoundColumn HeaderText="O/M Manuals" ></telerik:GridBoundColumn><br>                        <telerik:GridBoundColumn HeaderText="O/M Manuals" ></telerik:GridBoundColumn><br>                        <telerik:GridBoundColumn HeaderText="Dynamic Column1"></telerik:GridBoundColumn><br>                        <telerik:GridBoundColumn HeaderText="Dynamic Column2"></telerik:GridBoundColumn><br>                        <telerik:GridBoundColumn HeaderText="Dynamic Column3"></telerik:GridBoundColumn><br><br>                    </Columns><br><br>                </MasterTableView><br>            </telerik:RadGrid>

4 Answers, 1 is accepted

Sort by
0
Shridhar
Top achievements
Rank 1
answered on 18 Nov 2019, 06:50 PM
Can anybody please help me here. I need urgent help in creating columns (with multi header) dynamically and position on an existing radgrid with multiple header columns
0
Attila Antal
Telerik team
answered on 19 Nov 2019, 04:12 PM

Hi Shridhar,

Unfortunately I do not see the server side code with the re-ordering at your side, therefore, I am unable to pin-point the errors, however, we have a Documentation Article describing how to Order columns programmatically: Reordering columns programmatically

There is an important Note in the article saying "When using the OrderIndex property to reorder columns, make sure that you assign values so that no two columns have the same index and no index is omitted."

For urgent support, I advise that you open a formal Support Ticket with us. Our support staff will guarantee 24 hours response time for customers holding a "DevCraft Complete" license.

Kind regards,
Attila Antal
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Shridhar
Top achievements
Rank 1
answered on 19 Nov 2019, 06:35 PM

Thank you so much for your response.

there is no issue right now on my server side code and i am able to progress to create multiple header grid from the back end.

My question is that once the multiple header grid is created , what property shall i use to change the position of columns along with its group. Shall i change order index of each column under a column group.

Will doing the above will shift columns along with its group

0
Attila Antal
Telerik team
answered on 21 Nov 2019, 09:35 AM

Hi Shridhar,

Thank you for the clarification.

As you mentioned Multi Column headers, I remembered that this functionality does not support re-ordering of columns. Here is the official documentation article: Limitations - Reordering.

"Column reordering is available at the same level of sinigle column headers. This means that multi-column headers cannot be reordered and columns can only be reordered within their own column group."

 

With that said, you could only re-order the columns within the same group, or, if reordering one column, you must move all the other columns in the same group with it.

 

Kind regards,
Attila Antal
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Shridhar
Top achievements
Rank 1
Answers by
Shridhar
Top achievements
Rank 1
Attila Antal
Telerik team
Share this question
or