Show all columns programmatically?

2 posts, 0 answers
  1. Jason
    Jason avatar
    44 posts
    Member since:
    Apr 2013

    Posted 29 Oct 2013 Link to this post

    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?
  2. nikobellic
    nikobellic avatar
    46 posts
    Member since:
    Feb 2013

    Posted 29 Oct 2013 Link to this post

    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);
    }
  3. Kendo UI is VS 2017 Ready
Back to Top