This is a migrated thread and some comments may be shown as answers.

Forcing column width for narrow grids

1 Answer 468 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 1
Bill asked on 17 Jun 2020, 08:52 PM

In the column width page of the grid documentation https://docs.telerik.com/kendo-ui/controls/data-management/grid/columns/widths, it says:

 

When scrolling is enabled:

- When all columns have pixel widths and their sum is less than the width of the Grid, the column widths are ignored and the browser expands all columns.

 

Is there a way to disable that for certain columns?  Some of my columns - especially the command column - look really stupid when the auto-resizing adds a bunch of whitespace to them.

 

1 Answer, 1 is accepted

Sort by
0
Plamen Mitrev
Telerik team
answered on 18 Jun 2020, 09:38 AM

Hello Bill,

I explored the possibilities that you have before you and I have three  suggestions. Please find more details below.

  1. You can add an empty column at the end of the grid, which will take up the empty space, if the grid's width is more than all of its columns combined. Check the example here and see if that is applicable for your scenario.
  2. Another option is to leave at least one grid column without "width" configuration. That way this column, or multiple columns, will be stretched proportionately to fill the whole width of the grid. You can specify where the whitespace will be in advance. 
  3. Fix the grid width to a certain value, so it does not resize when the browser resizes.

I hope the above suggestions will help you configure the grid according to your requirements. Please do not hesitate to contact us again, if you need further assistance, or you have follow up questions.

Regards,
Plamen Mitrev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Grid
Asked by
Bill
Top achievements
Rank 1
Answers by
Plamen Mitrev
Telerik team
Share this question
or