Kendo UI columnMenu default column selections

4 posts, 0 answers
  1. Andrew
    Andrew avatar
    2 posts
    Member since:
    May 2016

    Posted 27 Jul Link to this post

    Hi. I am working on an Angular project which used Kendo Grid. I am aware that I can use the columnMenu property to give users the ability to filter columns that they want to see. Is there any way I can show some columns as default?

    This is my first post. please bear with me.

     

    -AZ

  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 29 Jul Link to this post

    Hello,

    I am not sure that I understand exactly the request, however I have two suggestions:

    1. If you want to filter by default, you can set the filters, using the filter() method of the dataSource, as shown here:

    http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#methods-filter

    2. You can use the columnMenuInit event and manipulate the content of the menu there, as documented here:

    http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#events-columnMenuInit

    In case this did not help - please elaborate a bit more.

    Regards,
    Kiril Nikolov
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  3. Kendo UI is VS 2017 Ready
  4. Andrew
    Andrew avatar
    2 posts
    Member since:
    May 2016

    Posted 01 Aug in reply to Kiril Nikolov Link to this post

    Hi Kiril,

    Thanks for replying. Let me try to rephrase my question.

    Let's say I have two columns in my grid, col A and col B. I want to hide col A when the grid displays initially and users should be able to show col A by marking the checkbox in the column menu later on. Does it make more sense?

    I think columnMenuInit is the way to go but I have not find a way to hide a column yet.

     

    -Andrew

  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 02 Aug Link to this post

    Hi,

    See the following documentation article:

    http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-hideColumn

    Regards,
    Kiril Nikolov
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
Back to Top
Kendo UI is VS 2017 Ready