How to hide Group column from the table body?

3 posts, 1 answers
  1. Answer
    Kate | D-Flo
    Kate | D-Flo avatar
    24 posts
    Member since:
    Jun 2013

    Posted 20 Jun 2013 Link to this post

    Hi,

    I have a table which is populated by the remote data. In the backend, I'm grouping by a column, which appears in groupHeaderTemplate - but this column is also shown in the table body. Is it possible to hide the group by column from the table body?

    I have an example from your demo available here: http://jsfiddle.net/ningencat/UHzcw/

    Could you show me how to hide the column UnitsInStock from the table?

    Thankyou
  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2289 posts

    Posted 24 Jun 2013 Link to this post

    Hello Kate,

    I'm not sure what you mean by saying: "to hide the group by column from the table body".
    However you can either set hidden attribute for the given column or remove it completely from Grid columns collection. Thus the column will not appear in Grid table except in the group headers.

    Regards,
    Nikolay Rusev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Mark
    Mark avatar
    18 posts
    Member since:
    Apr 2015

    Posted 22 Feb 2016 Link to this post

    Another neat little trick I have found is to hide the k-group-header div after setting a default grouping so that the user cannot delete the a grouping that they can not re-add.

    $(document).ready(function () {
        $("#grid").children(".k-grouping-header").hide();
    })
     
    ...
     
    @(Html.Kendo().Grid<Item>()
     
        ...
     
        .DataSource(datasource => datasource
            .Ajax()
            .Group(group => group.Add(column => column.Category))
        )
    )

Back to Top