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

Show all columns programmatically?

1 Answer 585 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 29 Oct 2013, 05:30 PM
I have a grid that I have added the ColumnMenu to that allows the user to pick which columns they would like to see.  I am creating a "Reset" button that will restore the grid to its original state.  How do I reshow ALL of the columns that are part of the datasource?

I need to somehow have an "ALL" because this grid is being built dynamically and different users will have different columns so I can't hard code the values in here...

Basically I just need to have something like this...

...
var grid = $('#ListAccountsGrid').data('kendoGrid');
grid.showColumn('ALL or *');
...

Anyone have any ideas?

1 Answer, 1 is accepted

Sort by
0
Ignacio
Top achievements
Rank 1
answered on 29 Oct 2013, 05:48 PM
The showColumn also has a overload that takes in an int

so maybe you could do
for(var i=0;i<grid.columns.length;i++){
    grid.showColumn(i);
}
Tags
Grid
Asked by
Jason
Top achievements
Rank 1
Answers by
Ignacio
Top achievements
Rank 1
Share this question
or