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

Change column index programmatically

4 Answers 425 Views
GridView
This is a migrated thread and some comments may be shown as answers.
jv
Top achievements
Rank 1
jv asked on 28 Oct 2010, 04:21 PM
Hello,

Since last version, how could I change column index, because now it seems that "Telerik.WinControls.UI.GridViewColumn.Index" is read only ?

Thanks.

4 Answers, 1 is accepted

Sort by
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 28 Oct 2010, 05:35 PM
Hello jv,

In the current version, on DataBindingComplete event you can move the columns by using
radGridView1.Columns.Move(oldIndex, newIndex)
or
radGridView1.Columns.Move(columnToMove, targetColumn, newIndex)

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
0
jv
Top achievements
Rank 1
answered on 29 Oct 2010, 09:20 AM
It works fine.

Thanks for your reactivity.
0
Christ
Top achievements
Rank 2
answered on 16 Feb 2017, 03:12 PM

Hi,

Using this now, works great!

 

Thank you!

0
Hristo
Telerik team
answered on 17 Feb 2017, 07:26 AM
Hello Christ,

Thank you for writing.

Indeed, that is the correct approach to reordering the columns. You can also check the following documentation article: http://docs.telerik.com/devtools/winforms/gridview/columns/reordering-columns.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
jv
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
jv
Top achievements
Rank 1
Christ
Top achievements
Rank 2
Hristo
Telerik team
Share this question
or