All Components

ColumnComponent

Represents the columns of the Grid.

@Component({
   selector: 'my-app',
   template: `
       <kendo-grid [data]="gridData">
         <kendo-grid-column field="ProductID" title="Product ID" width="120">
         </kendo-grid-column>
         <kendo-grid-column field="ProductName" title="Product Name">
         </kendo-grid-column>
         <kendo-grid-column field="UnitPrice" title="Unit Price" width="230">
         </kendo-grid-column>
         <kendo-grid-column field="Discontinued" width="120">
             <ng-template kendoGridCellTemplate let-dataItem>
                 <input type="checkbox" [checked]="dataItem.Discontinued" disabled/>
             </ng-template>
         </kendo-grid-column>
       </kendo-grid>
   `
})

class AppComponent {
   public gridData: any[];

   constructor() {
       this.gridData = products;
   }
}

const products = [{
   "ProductID": 1,
   "ProductName": "Chai",
   "UnitPrice": 18.0000,
   "Discontinued": true
 }, {
   "ProductID": 2,
   "ProductName": "Chang",
   "UnitPrice": 19.0000,
   "Discontinued": false
 }
];

Selector

kendo-grid-column

Inputs

class string | string[] | Set | {[key: string]: any}

Sets the custom CSS classes to the column cells.
The class option uses the NgClass
directive to apply the property under the hood.
To customize header and footer column cells,
use the headerClass
and footerClass inputs.

import { Component, ViewEncapsulation } from '@angular/core';

@Component({
   selector: 'my-app',
   encapsulation: ViewEncapsulation.None,
   styles: [`
       tr .myClass {
           text-align: right
      }
   `],
   template: `
       <kendo-grid [data]="gridData" style="height: 200px">
         <kendo-grid-column field="ProductName" title="Product Name" width="200" [class]="{'myClass': true}">
         </kendo-grid-column>
         <kendo-grid-column field="UnitPrice" title="Unit Price" width="230">
         </kendo-grid-column>
       </kendo-grid>
   `
})

class AppComponent {
   public gridData: any[];

   constructor() {
       this.gridData = [{
           "ProductID": 1,
           "ProductName": "Chai",
           "UnitPrice": 18.0000,
           "Discontinued": true
         }, {
           "ProductID": 2,
           "ProductName": "Chang",
           "UnitPrice": 19.0000,
           "Discontinued": false
         }];
   }
}

editable boolean

Defines whether the column is editable. The default value is true.

<kendo-grid>
   <kendo-grid-column field="UnitPrice" [editable]="false">
   </kendo-grid-column>
</kendo-grid>

editor "text" | "numeric" | "date" | "boolean"

Defines the editor type. Used when the column enters the edit mode. The default editor type is text.

<kendo-grid>
   <kendo-grid-column field="UnitPrice" [editor]="'numeric'">
   </kendo-grid-column>
</kendo-grid>

field string

The field to which the column is bound.

filter "text" | "numeric" | "boolean" | "date"

Defines the filter type that is displayed inside the filter row. The default value is text.

<kendo-grid>
   <kendo-grid-column field="UnitPrice" [filter]="'numeric'">
   </kendo-grid-column>
</kendo-grid>

filterable boolean

Defines if a filter UI will be displayed for this column. The default value is true.

<kendo-grid>
   <kendo-grid-column field="UnitPrice" [filterable]="false">
   </kendo-grid-column>
</kendo-grid>

footerClass string | string[] | Set | {[key: string]: any}

Sets the custom CSS classes to the column footer cell.
The footerClass option uses the NgClass
directive to apply the property under the hood.

import { Component, ViewEncapsulation } from '@angular/core';

@Component({
   selector: 'my-app',
   encapsulation: ViewEncapsulation.None,
   styles: [`
       tr .myClass {
           text-align: right
      }
   `],
   template: `
       <kendo-grid [data]="gridData" style="height: 200px">
         <kendo-grid-column field="ProductName" title="Product Name" width="200" [footerClass]="{'myClass': true}">
             <ng-template kendoGridFooterTemplate>
                 footer text
             </ng-template>
         </kendo-grid-column>
         <kendo-grid-column field="UnitPrice" title="Unit Price" width="230">
         </kendo-grid-column>
       </kendo-grid>
   `
})

class AppComponent {
   public gridData: any[];

   constructor() {
       this.gridData = [{
           "ProductID": 1,
           "ProductName": "Chai",
           "UnitPrice": 18.0000,
           "Discontinued": true
         }, {
           "ProductID": 2,
           "ProductName": "Chang",
           "UnitPrice": 19.0000,
           "Discontinued": false
         }];
   }
}

footerStyle {[key: string]: string}

Sets the custom styles for the footer cell of the column.
The footerStyle option uses the NgStyle
directive to apply the property under the hood.

@Component({
   selector: 'my-app',
   template: `
       <kendo-grid [data]="gridData" style="height: 200px">
         <kendo-grid-column field="ProductName" title="Product Name" width="200" [footerStyle]="{'text-align': 'right'}">
             <ng-template kendoGridFooterTemplate>
                 footer text
             </ng-template>
         </kendo-grid-column>
         <kendo-grid-column field="UnitPrice" title="Unit Price" width="230">
         </kendo-grid-column>
       </kendo-grid>
   `
})

class AppComponent {
   public gridData: any[];

   constructor() {
       this.gridData = [{
           "ProductID": 1,
           "ProductName": "Chai",
           "UnitPrice": 18.0000,
           "Discontinued": true
         }, {
           "ProductID": 2,
           "ProductName": "Chang",
           "UnitPrice": 19.0000,
           "Discontinued": false
         }];
   }
}

format string

The format that is applied to the value before it is displayed.
Takes the {0:format} form where format is a standard number format, a custom number format,
a standard date format, or a custom date format.

For more information on the supported date and number formats,
refer to the kendo-intl documentation.

<kendo-grid>
   <kendo-grid-column field="UnitPrice" format="{0:c}">
   </kendo-grid-column>
</kendo-grid>

headerClass string | string[] | Set | {[key: string]: any}

Sets the custom CSS classes to the column header cell.
The headerClass option uses the NgClass
directive to apply the property under the hood.

import { Component, ViewEncapsulation } from '@angular/core';

@Component({
   selector: 'my-app',
   encapsulation: ViewEncapsulation.None,
   styles: [`
       tr .myClass {
           text-align: right
      }
   `],
   template: `
       <kendo-grid [data]="gridData" style="height: 200px">
         <kendo-grid-column field="ProductName" title="Product Name" width="200" [headerClass]="{'myClass': true}">
         </kendo-grid-column>
         <kendo-grid-column field="UnitPrice" title="Unit Price" width="230">
         </kendo-grid-column>
       </kendo-grid>
   `
})

class AppComponent {
   public gridData: any[];

   constructor() {
       this.gridData = [{
           "ProductID": 1,
           "ProductName": "Chai",
           "UnitPrice": 18.0000,
           "Discontinued": true
         }, {
           "ProductID": 2,
           "ProductName": "Chang",
           "UnitPrice": 19.0000,
           "Discontinued": false
         }];
   }
}

headerStyle {[key: string]: string}

Sets the custom styles for the header cell of the column.
The headerStyle option uses the NgStyle
directive to apply the property under the hood.

@Component({
   selector: 'my-app',
   template: `
       <kendo-grid [data]="gridData" style="height: 200px">
         <kendo-grid-column field="ProductName" title="Product Name" width="200" [headerStyle]="{'text-align': 'right'}">
         </kendo-grid-column>
         <kendo-grid-column field="UnitPrice" title="Unit Price" width="230">
         </kendo-grid-column>
       </kendo-grid>
   `
})

class AppComponent {
   public gridData: any[];

   constructor() {
       this.gridData = [{
           "ProductID": 1,
           "ProductName": "Chai",
           "UnitPrice": 18.0000,
           "Discontinued": true
         }, {
           "ProductID": 2,
           "ProductName": "Chang",
           "UnitPrice": 19.0000,
           "Discontinued": false
         }];
   }
}

hidden boolean (default: false)

Sets the visibility of the column.

locked boolean (default: false)

Toggles the locked (frozen) state of the columns.
Locked (frozen) columns are visible at all times during the horizontal scrolling of the Grid.
For the option to work properly, make sure that the Grid is configured to meet the following requirements:

  • Scrolling is enabled.
  • The height option of the Grid is set.
  • The widths of all Grid columns are explicitly set in pixels. In this way, the Grid adjusts the layout of the frozen and non-frozen columns.
@Component({
   selector: 'my-app',
   template: `
       <kendo-grid [data]="gridData" [scrollable]="scrollable" style="height: 200px">
         <kendo-grid-column field="ProductID" title="Product ID" width="120" [locked]="true">
         </kendo-grid-column>
         <kendo-grid-column field="ProductName" title="Product Name" width="200">
         </kendo-grid-column>
         <kendo-grid-column field="UnitPrice" title="Unit Price" width="230">
         </kendo-grid-column>
       </kendo-grid>
   `
})

class AppComponent {
   public gridData: any[];

   constructor() {
       this.gridData = products;
   }
}

const products = [{
   "ProductID": 1,
   "ProductName": "Chai",
   "UnitPrice": 18.0000,
   "Discontinued": true
 }, {
   "ProductID": 2,
   "ProductName": "Chang",
   "UnitPrice": 19.0000,
   "Discontinued": false
 }
];

media string

Sets the condition that needs to be satisfied for a column to remain visible.

If you set the hidden property, the behavior of media is overridden.

<kendo-grid>
   <kendo-grid-column field="UnitPrice" [media]="'(min-width: 320px)'">
   </kendo-grid-column>
</kendo-grid>

Accepts the device identifiers that are available in Bootstrap 4:

  • "xs"—Equivalent to "(max-width: 576px)".
  • "sm"—Equivalent to "(min-width: 576px)".
  • "md"—Equivalent to "(min-width: 768px)".
  • "lg"—Equivalent to "(min-width: 992px)".
  • "xl"—Equivalent to "(min-width: 1200px)".
<kendo-grid>
   <kendo-grid-column field="UnitPrice" [media]="'md'">
   </kendo-grid-column>
</kendo-grid>

minResizableWidth number

The width (in pixels) below which the user is not able to resize the column by using the UI.

resizable boolean (default: true)

Indicates whether the column is resizable or not.

sortable boolean | ColumnSortSettings

Allows the column headers to be clicked and the sortChange event emitted.
You have to handle the sortChange event yourself and sort the data.

style {[key: string]: string}

Sets the custom styles for the table cells (excluding the footer and header ones) of the column.
The style option uses the NgStyle
directive to apply the property under the hood.

@Component({
   selector: 'my-app',
   template: `
       <kendo-grid [data]="gridData" style="height: 200px">
         <kendo-grid-column field="ProductName" title="Product Name" width="200" [style]="{'text-align': 'right'}">
         </kendo-grid-column>
         <kendo-grid-column field="UnitPrice" title="Unit Price" width="230">
         </kendo-grid-column>
       </kendo-grid>
   `
})

class AppComponent {
   public gridData: any[];

   constructor() {
       this.gridData = [{
           "ProductID": 1,
           "ProductName": "Chai",
           "UnitPrice": 18.0000,
           "Discontinued": true
         }, {
           "ProductID": 2,
           "ProductName": "Chang",
           "UnitPrice": 19.0000,
           "Discontinued": false
         }];
   }
}

title string

The title of the column.

width number

The width of the column (in pixels).

In this article