This is a migrated thread and some comments may be shown as answers.

how to get the hide columns information in telerik radgrid.

1 Answer 34 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
dilip
Top achievements
Rank 1
dilip asked on 22 May 2013, 02:20 PM

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.




1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 27 May 2013, 12:26 PM
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.
Tags
General Discussions
Asked by
dilip
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or