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

Double click in resize columns

7 Answers 253 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ane
Top achievements
Rank 1
Ane asked on 06 Aug 2012, 09:03 PM
Is there any way to automatically resize the width of the column so you can see the whole data when you double click on the resize cursor?

I know you can drag the resize pointer to the width you want, but I would like to set the optimal size in order to see everything when the user double clicks on it. Is that possible?

Thanks,

7 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 07 Aug 2012, 10:44 AM
Hello Ane,

The Grid doesn't have such functionality. However you can implemented yourself. I am attaching jsFiddle which demonstrates one possible way to implement this for non scrollable grid. You can use it as a reference for more sophisticated implementation.
http://jsfiddle.net/YF7ny/

All the best,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dave
Top achievements
Rank 1
answered on 12 Oct 2012, 02:50 PM
As Nikolay mentioned, the above example only works when scrollable is false.  When scrollable is true, the header acts as another table.

This jsFiddle example may break on future updates ( I make assumptions about the header object), but for now it works on the last version of kendo with scrolling turned on.

 
0
Winston
Top achievements
Rank 1
answered on 05 Nov 2012, 11:09 PM
Ane
When I double click to resize Ship Name, Ship City disappears from the grid. And when I double click Order Date, the width goes wider than the date. Have you found a way to address this? I would really like to know. Thanks!
0
Ane
Top achievements
Rank 1
answered on 06 Nov 2012, 04:16 PM
Hi Winston,

I didn't do it. I'm just using the normal resize. Sorry.
0
Bharat
Top achievements
Rank 1
answered on 16 Apr 2014, 07:54 AM
Hi,

I have tried with the code which you shared on link it works fine in example with html grid but it is not working for Column Header if we use the Kendo Grid MVC Wrapper. It will only re size the contents not header width.

Any Better solution?

Thanks
Bharat
0
Egorov
Top achievements
Rank 1
answered on 09 Sep 2015, 04:27 PM

Hi,

In version 2015.2.805 double click on column header resize area is  automatically resize the width of the column, 

but this bug is still here. 

If you autoresize first 3 columns width of other two is too smal to see anithing and scroll is not avalible and when autoresize next column the last is disappeare

http://jsfiddle.net/YF7ny/227/

0
Nikolay Rusev
Telerik team
answered on 12 Sep 2015, 08:05 AM

Hello Egorov,

 

I'm not able to replicate this behavior - http://screencast.com/t/s0guXO91c

 

Am I missing something?

 

Regards,
Nikolay Rusev
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
Ane
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Dave
Top achievements
Rank 1
Winston
Top achievements
Rank 1
Ane
Top achievements
Rank 1
Bharat
Top achievements
Rank 1
Egorov
Top achievements
Rank 1
Share this question
or