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

Minimum Width For One Column

2 Answers 550 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 2
Iron
Brian asked on 17 Dec 2018, 07:57 PM

Hi,

I have a grid that has one dynamically sized column to maximize space (it contains the most data).  As the browser window is resized to be smaller and that column shrinks, it eventually disappears.  All of the other columns are auto-sized to contents.

Is there a way to set a minimum width for the column so that when I resize the browser window, it will freeze the width of that column when it reaches a certain threshold and scroll instead?

(I am using the MVC suite of controls.)

Thanks!
Brian

2 Answers, 1 is accepted

Sort by
0
Accepted
Viktor Tachev
Telerik team
answered on 19 Dec 2018, 12:37 PM
Hi Brian,

By default when a column has no width specified the browser will resize it to take the available space. In some scenarios the column can get to zero width.

To avoid that I would suggest setting the width option for all columns. If the sum of all columns' widths is less than the width of the Grid the browser will resize them to fit the space. However, when the width of the Grid becomes less than the combined width of the columns a scrollbar will appear. For more information on the specifics related to column widths please check out the article below.



Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Brian
Top achievements
Rank 2
Iron
answered on 19 Dec 2018, 02:04 PM

Hi Viktor,

You're absolutely right.  I was using something like autoResizeColumn() in JS which was messing everything up.  I removed that, assigned a hard width to all of the columns, and they resized perfectly.

Thanks so much for all your help!
Brian

Tags
Grid
Asked by
Brian
Top achievements
Rank 2
Iron
Answers by
Viktor Tachev
Telerik team
Brian
Top achievements
Rank 2
Iron
Share this question
or