New to Kendo UI for Angular? Start a free 30-day trial
ColumnMenuAutoSizeColumnComponent
Represents the column-menu item for resizing the specified column to the minimum possible width so that it fits the header or cell content without wrapping. See example.
Place this component inside a ColumnMenuTemplate
directive.
Set the ColumnMenuService
and column
passed by
the template to the service
and column
inputs of the kendo-grid-columnmenu-autosize-column
component.
html
<kendo-grid [columnMenu]="true" ...>
<ng-template kendoGridColumnMenuTemplate let-service="service" let-column="column">
<kendo-grid-columnmenu-autosize-column [column]="column" [service]="service">
</kendo-grid-columnmenu-autosize-column>
</ng-template>
</kendo-grid>
html
<kendo-grid-column field="ProductName">
<ng-template kendoGridColumnMenuTemplate let-service="service">
<kendo-grid-columnmenu-autosize-column [column]="column" [service]="service">
</kendo-grid-columnmenu-autosize-column>
</ng-template>
</kendo-grid-column>
Selector
kendo-grid-columnmenu-autosize-column
Inputs
Name | Type | Default | Description |
---|---|---|---|
column |
|
Specifies the Grid column instance to resize with the auto size column option. | |
service |
|
Represents the |
Methods
autoSizeColumn |
---|
Resizes the specified column to the minimum possible width so that it fits the widest header or cell content without wrapping. |