how to get the hide columns information in telerik radgrid.

2 posts, 0 answers
  1. dilip
    dilip avatar
    2 posts
    Member since:
    Sep 2008

    Posted 22 May 2013 Link to this post

    I am using Telerik Grid in my project.I set the "EnableHeaderContextMenu="true" to Hide/Show the Grid Columns. My requirement we are hiding some columns from Grid, I want to know which Columns are hided.




  2. Andrey
    Admin
    Andrey avatar
    836 posts

    Posted 27 May 2013 Link to this post

    Hello,

    In order to achieve your goal you could use the following code:

    var grid = $find("RadGrid1");
    var masterTableView = grid.get_masterTableView();
    var columns = masterTableView.get_columns();
    for (var i = 0; i < length; i++) {
        if(columns[i].get_element().offsetWidth == 0)
        {
                //The column is hidden
        }
    }

    Regards,
    Andrey
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top