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

Change column order for columns created in design

1 Answer 111 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Cata
Top achievements
Rank 1
Cata asked on 18 Mar 2016, 12:10 PM

Hi,

I'm interested in changing the order of the columns at runt-time for columns created in design-view. I have tried in Grid_PreRender but it doesn't work

Also, is it possible mix dynamically created columns with columns created in design?

 

Thanks,

catalin

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 22 Mar 2016, 07:35 AM
Hello Catalin,

You should be able to change the order of columns by calling the SwapColumns method. Check out the following article for description on how you can change the order of columns in RadGrid:


With that said, it is not recommended to mix declarative and programmatic creation of columns. It is best to stick with one approach - either define all columns in the markup or use the code-behind to create them dynamically.

Check out the following article that describes in more detail how you can define the RadGrid structure dynamically.



Regards,
Viktor Tachev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
Cata
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or