Grid Group Header Text

4 posts, 0 answers
  1. Austin
    Austin avatar
    17 posts
    Member since:
    Oct 2008

    Posted 27 Feb 2013 Link to this post

    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

  2. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2622 posts

    Posted 01 Mar 2013 Link to this post

    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!
  3. Mark
    Mark avatar
    21 posts
    Member since:
    Aug 2015

    Posted 10 Oct 2017 in reply to Iliana Nikolova Link to this post

    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
  4. Preslav
    Admin
    Preslav avatar
    516 posts

    Posted 12 Oct 2017 Link to this post

    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.
Back to Top