Reordering the columns of grid

2 posts, 0 answers
  1. Babak
    Babak avatar
    9 posts
    Member since:
    Jan 2014

    Posted 26 Jan 2015 Link to this post

    We have a special toggle mode in our forms that if it is set to true, I don't want to be able to reorder the columns of the grid and otherwise want to allow reordering the columns.
    I found the event ColumnReordering and the property CanUserReorderColumns
    and used them as following:
    The problem is that it works but not for the very first time of reordering the columns, for first time of reordering the columns it still allows it to be reordered but after that it works for other columns.

    void MyGridView_ColumnReordering(object sender, ColumnReorderingEventArgs e)
        if (this.ThatToggleMode!= null)
            if (this.InThatToggleMode)
                this.CanUserReorderColumns = false;
                e.Handled = true;
                this.CanUserReorderColumns = true;

  2. Boris
    Boris avatar
    276 posts

    Posted 29 Jan 2015 Link to this post

    Hello Babak,

    A possible way to solve this is to set initially the CanUserReorderColumns property of RadGridView to "False" in XAML or code-behind and then change it through your toggle mode.

    On a side note for more information about reordering columns you can check the Reordering Columns documentation article.

    I hope this helps. 


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. DevCraft R3 2016 release webinar banner
Back to Top