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

Grid Column Resizing issue

4 Answers 383 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Piyush Bhatt
Top achievements
Rank 1
Piyush Bhatt asked on 19 Jan 2015, 09:31 PM
Hi,

I am facing column re-sizing issues with Kendo Grid. While re-sizing the column, it is stretching too far.
You can have look at below example. Each column having some width.
http://dojo.telerik.com/eFEYI

can anyone help me?

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 20 Jan 2015, 12:38 PM
Hello Piyush,

All columns have explicit widths, which are too small, and this causes the observed problem. Please refer to the relevant documentation:

http://docs.telerik.com/kendo-ui/web/grid/appearance#column-widths

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Bridge24
Top achievements
Rank 1
Iron
answered on 27 Mar 2015, 07:50 PM
Oh! I have a bug that looks exactly the same, but I found that if my rows goes over the "container", I mean, if the horizontal scroll is visible, everything is OK.  If no scroll, but in resize.

But, I found a fix... if I hide and show a column, some kind of "redraw" is performed, and after that, everything is fine.

My case: http://dojo.telerik.com/ECAro/13
Fix found:  (fix button in the test case)

var grid = $('#grid1').kendoGrid({params...}).data('kendoGrid');
grid.hideColumn(0);
grid.showColumn(0);

If kendo automatically call what is called when we do a show-hide, on the grid creation, it will fix that bug.

0
Bridge24
Top achievements
Rank 1
Iron
answered on 27 Mar 2015, 07:51 PM
quick fix:
grid.hideColumn(0);
grid.showColumn(0);
0
Dimo
Telerik team
answered on 31 Mar 2015, 02:59 PM
Hello Daniel,

Instead of hiding and showing a column (which is a relatively expensive operation in terms of performance), you can also set a pixel width to the two Grid tables, which corresponds to the sum of all column widths. This is what actually happens when you change a column visibility and all remaining visible columns have widths.

http://docs.telerik.com/kendo-ui/web/grid/appearance#scrolling

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Piyush Bhatt
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Bridge24
Top achievements
Rank 1
Iron
Share this question
or