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

How to hide Group column from the table body?

2 Answers 334 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kate | D-Flo
Top achievements
Rank 1
Kate | D-Flo asked on 20 Jun 2013, 10:59 AM
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 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 24 Jun 2013, 06:12 AM
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!
0
Mark
Top achievements
Rank 1
Veteran
answered on 22 Feb 2016, 02:24 PM

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))
    )
)

Tags
Grid
Asked by
Kate | D-Flo
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Mark
Top achievements
Rank 1
Veteran
Share this question
or