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

automatic column widths, which depend on the cell content

2 Answers 621 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dominik
Top achievements
Rank 1
Dominik asked on 24 Jul 2015, 02:57 PM
The documentation states that, "...it is not possible to have a scrollable Grid with automatic table layout (i.e. automatic column widths, which depend on the cell content".  Is there a workaround to get this functionality or is it really impossible? 

2 Answers, 1 is accepted

Sort by
0
Accepted
Venelin
Telerik team
answered on 27 Jul 2015, 07:56 AM
Hello Dominik,

It's really not possible as explained in this forum thread too:

http://www.telerik.com/forums/dynamically-resize-kendo-grid-and-columns-how#ZVZ-vlMhzEaRzJzCeoWANg

Of course workarounds exist but you sacrificing the usability of the grid and possibly introducing bugs:

http://www.telerik.com/forums/grid-column-width-auto-size-and-scrollable

Regards,
Venelin
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Dominik
Top achievements
Rank 1
answered on 16 Oct 2015, 03:42 PM

Here is a workaround that works with scrolling enabled:

dataBound: function(){
                        var grid = $("#grid").data("kendoGrid");
                        for (var i = 0; i < grid.columns.length; i++) {
                            grid.autoFitColumn(i);
                        }
                    }

Tags
Grid
Asked by
Dominik
Top achievements
Rank 1
Answers by
Venelin
Telerik team
Dominik
Top achievements
Rank 1
Share this question
or