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

[Solved] Column resizing

6 Answers 177 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jerry
Top achievements
Rank 1
Jerry asked on 10 May 2011, 05:43 AM
Hi there,


I have a few problems with column resizing.

1) when I try to shrink a column, there are some blank spaces on the right of the grid. See attached blank-space.png
 I was wondering how to automatically adjust size of other columns so I can get rid of this blank spaces.


2) Our application are designed to support different size of screens. When I open the application on a larger screen, and try to resize one of the column, either increase or decrease the width. Then I move the application to a smaller screen. It looks really weird. As you can see from 2.png and 3.png, user has to scroll right, in order to see all the columns. This is strange because I explicitly set all the column width to percentage, I thought all the columns should resize according the percentage. 
Note: columns do resize according to the width setting perfectly before column resize.

Could someone give me a sample solution or something?


regards
Jerry

6 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 10 May 2011, 06:17 AM
Hi Jerry,

1) This is by design. The grid tables have fixed layout ("table-layout:fixed") because you have enabled scrolling which means the widths of the columns work as specified. This allows for the shrinking of the grid. If this is not desired you can disable grid scrolling.
2) Column resizing works with absolute sizes (pixels). Once you start resizing the column its size is no longer percentage based. I am afraid Telerik Grid for ASP.NET MVC does not support resizing with relative sizes (percentages) and I don't think I can offer any workaround.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jerry
Top achievements
Rank 1
answered on 13 May 2011, 07:47 AM
Hi Atanas,


Thank you for your reply.


I'm having another problem with column width now.
I want to save the column width as a per user preference. I saved the column settings in the database, so I can load it later.

1) I set default column width in GridColumnSettings, then load it in the grid.

2) every time a user trying to resize the column width, I pass this column width as percentage back to server side, set this width in the column setting and save it in the database.

the problem is that when a user load the page again, which use the column settings that I saved in the database previously. The column header and content are not aligned to each other. As you can see the attached error.png picture. Working.png is what should looks like. Because I have a tab control, when I click on another tab then come back, it looks fine, as show in working.png.


Could you tell me what cause this problem? and is it possible to provide an example?

Well, hope I made myself clear. Thank you so much.



regards
Jerry
0
Atanas Korchev
Telerik team
answered on 13 May 2011, 07:52 AM
Hello Jerry,

 I am afraid this is not a known issue. Our column resizing example implements a similar case - setting the column widths from server side and works ok. What is different in your implementation? Is there a chance to provide a sample project?

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jerry
Top achievements
Rank 1
answered on 17 May 2011, 04:52 AM
Is it because that I used a mixture width setting of absolute width and percentage width?

I will prepare a sample project.

Thank you Atanas.
0
Atanas Korchev
Telerik team
answered on 17 May 2011, 04:57 AM
Hi Jerry,

 As I said before column resizing will not work with percentages. Once you start resizing a column it converts its width to absolute (pixel). If you later try to mix percentages (for columns which have not been resized) with absolute values (pixels for the resized columns) the sum of the column widths will not sum up to the total width of the grid which will lead to unpredictable behavior.

Kind regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Mahesh
Top achievements
Rank 1
answered on 21 Aug 2012, 05:52 AM
Hi Atanas,

I am facing problem that.....
On resizing of one column  (of Telerik mvc grid )  other columns are also resizing  ....How to avoid this.... or else pls tell me how to get width of the column  in the client events of grid or in javascript........
Pls inform me....I am waiting for your reply


Thanks & Regards,

Mahesh. 
Tags
Grid
Asked by
Jerry
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Jerry
Top achievements
Rank 1
Mahesh
Top achievements
Rank 1
Share this question
or