如何根据 Kendo-Angular2-grid 中的数据自动调整网格列的大小?

How to auto resize grid columns based on the data in Kendo-Angular2-grid?

我正在使用 Telerik 网页上提到的 plunker: http://www.telerik.com/kendo-angular-ui/components/grid/

我尝试将列宽更改为自动,但它不起作用。

根据 documentation 目前 kendo 网格列仅支持以像素指定的宽度:

width

The width of the column in pixels.

但是,如果您不为一个或多个列提供此 属性,它将占用所有 remaning space(如果超过一个,则均分)。

因此,如果您希望列的宽度自动设置,只需在其定义中跳过此 属性。