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

Grid Group Header Text

3 Answers 1207 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Austin
Top achievements
Rank 1
Austin asked on 27 Feb 2013, 09:36 PM

I have a Grid grouped by a column and I would like to remove the column name and just keep the value in the group header.

for example:  I am grouping by a field called ProductType..  when my grid loads, the group header displays like this  ProductType: Cars

But I want the group header to just display Cars and not the field name also.

Thanks in Advance

3 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 01 Mar 2013, 02:39 PM
Hi Austin,

You can achieve this as set groupHeaderTemplate for the ProductType column. For example: 
columns: [
  { field: "ProductType", title: "Product Type",  groupHeaderTemplate: "#= value #", //....},
  //....
]

Kind regards,

Iliana Nikolova
the Telerik team
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
answered on 10 Oct 2017, 06:36 PM
How do you it for Boolean fields?  For instance, I have an "Is Valid" column which shows Valid or Invalid.  I use a template for the column, but if the user groups by that field is shows "true" or "false".  How do I change the Group Header to use a conditional template?  Thanks
0
Preslav
Telerik team
answered on 12 Oct 2017, 12:04 PM
Hello Mark,

To achieve the desired functionality use the value field of the columns.groupHeaderTemplate property. 
For example: 

groupHeaderTemplate: "#: value ? 'Valid' : 'Invalid' #"

For a runnable example, check my testing Dojo: https://dojo.telerik.com/ACUgeN

I hope this helps.


Regards,
Preslav
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Austin
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Mark
Top achievements
Rank 1
Preslav
Telerik team
Share this question
or