Change column index programmatically

5 posts, 1 answers
  1. jv
    jv avatar
    4 posts
    Member since:
    Aug 2012

    Posted 28 Oct 2010 Link to this post

    Hello,

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

    Thanks.
  2. Answer
    Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 28 Oct 2010 Link to this post

    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
  3. jv
    jv avatar
    4 posts
    Member since:
    Aug 2012

    Posted 29 Oct 2010 Link to this post

    It works fine.

    Thanks for your reactivity.
  4. Christ
    Christ avatar
    9 posts
    Member since:
    Feb 2011

    Posted 16 Feb 2017 Link to this post

    Hi,

    Using this now, works great!

     

    Thank you!

  5. Hristo
    Admin
    Hristo avatar
    1520 posts

    Posted 17 Feb 2017 Link to this post

    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.
Back to Top