• Getting Started
  • Components
    • Barcodes
    • Buttons
    • Chartsupdated
    • Conversational UIupdated
    • Data Query
    • Date Inputsupdated
    • Date Math
    • Dialogs
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Filter
    • Gantt
    • Gauges
    • Gridupdated
    • Icons
    • Indicators
    • Inputsupdated
    • Labels
    • Layout
    • ListBox
    • ListView
    • Map
    • Menus
    • Navigation
    • Notification
    • Pager
    • PDF Export
    • PDFViewer
    • PivotGridupdated
    • Popup
    • ProgressBars
    • Ripple
    • Schedulerupdated
    • ScrollView
    • Sortable
    • Spreadsheetupdated
    • ToolBar
    • Tooltips
    • TreeList
    • TreeView
    • Typography
    • Uploads
    • Utilities
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Sample Applications
  • FAQ
  • Troubleshooting
  • Updates
  • Changelogs
New to Kendo UI for Angular? Start a free 30-day trial

GroupTemplateDirective

Renders the group header content. To define the group template, nest an <ng-template> tag with the kendo<ComponentName>GroupTemplate directive inside the component tag. The template context is set to the current component. To get a reference to the current data item, use the let-groupName directive.

import { groupBy } from '@progress/kendo-data-query';
@Component({
selector: 'my-app',
template: `
 <kendo-combobox [data]="groupedData" textField="name" valueField="name">
   <ng-template kendoComboBoxGroupTemplate let-groupName>
     <span>Food type: {{groupName}} option</span>
   </ng-template>
 </kendo-combobox>
`
})
class AppComponent {
  public data = [
      { name: "Pork", category: "Food", subcategory: "Meat" },
      { name: "Pepper", category: "Food", subcategory: "Vegetables" },
      { name: "Beef", category: "Food", subcategory: "Meat" }
  ];
  public groupedData = groupBy(this.data, [{field: "subcategory"}]);
}

Selector

[kendoDropDownListGroupTemplate],[kendoComboBoxGroupTemplate],[kendoMultiColumnComboBoxGroupTemplate],[kendoAutoCompleteGroupTemplate],[kendoMultiSelectGroupTemplate]

In this article

Not finding the help you need?