All Components

ColumnComponent

Represents the columns of the Kendo UI Grid component for Angular.


@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">
             <template kendoCellTemplate let-dataItem>
                 <input type="checkbox" [checked]="dataItem.Discontinued" disabled/>
             </template>
         </kendo-grid-column>
       </kendo-grid>
   `
})

class AppComponent {
   private 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<string> | {[key: string]}: any}

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

field string

The field to which the column is bound.

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

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

footerStyle {[key: string]}: string}

Sets the custom styles for the column footers. The footerStyle option uses NgStyle to apply the property under the hood.

format string

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

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

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

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

headerStyle {[key: string]}: string}

Sets the custom styles to be applied to the column headers. The headerStyle option uses NgStyle to apply the property under the hood.

locked boolean

Toggles the column locked (frozen) state. Locked (frozen) columns are visible at all times during the horizontal Grid scrolling. 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 is able to adjust 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 {
   private 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
 }
];

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 to be applied to the column cells. The style option uses NgStyle to apply the property under the hood.

title string

The title of the column.

width number

The width of the column in pixels.

In this article