Custom Column Order Per User

3 posts, 0 answers
  1. Matthew
    Matthew avatar
    2 posts
    Member since:
    Dec 2014

    Posted 19 May 2016 Link to this post


    I am trying to capture the order of columns headers after a user changes (re-orders) a column in the Grid. But so far I only seem to capture the original order.

    I plan to store the order in the database, and when the grid is loaded re-order the columns for each user.


    Here's a code snip that gets called after a user changes a column: (always gets original order) 

    string sVal = "";
    GridColumnCollection cols = grid.MasterTableView.Columns;
    GridColumn c;
    string[] sOrder = new string[grid.Items[0].Cells.Count];
     for (int i = 0; i < grid.Items[0].Cells.Count; i++)
                    sVal = grid.Items[0].Cells[i].ID.ToString();
                    c = cols.FindByUniqueNameSafe(sVal);
                    sOrder[i] = sVal + ":" + i.ToString();

    How do I get the actual order of columns after they are changed by the user? 

  2. Matthew
    Matthew avatar
    2 posts
    Member since:
    Dec 2014

    Posted 19 May 2016 in reply to Matthew Link to this post

    Is it possible to change the grid's display order by JavaScript? 
  3. Konstantin Dikov
    Konstantin Dikov avatar
    2466 posts

    Posted 24 May 2016 Link to this post

    Hi Matthew,

    For retrieving the order index of a column on server-side you could use the OrderIndex property of the columns:
    As for the reordering on client-side, please refer to the following help article:
    Hope this helps.

    Konstantin Dikov
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top