How to get a list of visible columns server-side

2 posts, 0 answers
  1. Al
    Al avatar
    203 posts
    Member since:
    Oct 2006

    Posted 12 Oct Link to this post

    Hi ,

    How can I find out which columns are visible in a server-side routine (some columns may have been shown/hidden with the header context menu)?

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1796 posts

    Posted 17 Oct Link to this post

    Hello Al,

    You can traverse the Columns collection of the grid and check their Display and Visible properties:
    List<GridColumn> columns = new List<GridColumn>();
    foreach (GridColumn column in RadGrid1.MasterTableView.RenderColumns)
    {
        if (column.Display == true && column.Visible)
        {
            columns.Add(column);
        }
    }

    Hope this helps.


    Regards,
    Konstantin Dikov
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top