grid column with %

1 Answer 54 Views
Grid
ixen
Top achievements
Rank 1
Iron
Iron
Iron
ixen asked on 21 Oct 2021, 03:32 PM

Hi

I have tried without succes to define column witdth in % ? Could you help me ?

Regards


  <kendo-grid-column field="date" title="{{'page.column.date' | translate | titlecase}}" [width]="25%"></kendo-grid-column>

1 Answer, 1 is accepted

Sort by
0
Hetali
Telerik team
answered on 21 Oct 2021, 08:10 PM

Hello Ixen,

The width property of the ColumnComponent only accepts a number which is considered in pixels. To add the width in percent, use the style and the headerStyle property as seen below:

<kendo-grid>
  <kendo-grid-column 
    field="ProductID" 
    [style]="{'width': '25%'}" 
    [headerStyle]="{'width': '25%'}"
  >
  </kendo-grid-column>
</kendo-grid>

In this StackBlitz example, I have assigned the width of the column in percentage.

I hope this helps. Let me know if you have any further questions.

Regards,
Hetali
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
ixen
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Hetali
Telerik team
Share this question
or