This question is locked. New answers and comments are not allowed.
Temesgen Meheret
Top achievements
Rank 1
Temesgen Meheret
asked on 09 Mar 2010, 07:32 PM
Two issues:
1.
I tried to resize the column of telerik MVC grid by setting width. but it doesn't seem to change the width at all.
2.
Whenever I add sortable and pageable behavior to the Grid, the table size automatically expands. How can I prevent that.
Thanks,
10 Answers, 1 is accepted
0
Hello Temesgen Meheret,
Setting column width is supposed to work. We are using it in every grid example in the online demos. How is your scenario different? Could you paste some sample code here?
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.
Setting column width is supposed to work. We are using it in every grid example in the online demos. How is your scenario different? Could you paste some sample code here?
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
Temesgen Meheret
Top achievements
Rank 1
answered on 09 Apr 2010, 04:29 PM
Please close this thread.
0
Phil Applegate
Top achievements
Rank 1
answered on 09 Aug 2010, 02:35 PM
Got the same issue. Setting
doesn't seem to affect the actual width of column.
colums.Bound(o => o.Date).Width(200);0
ibrahim
Top achievements
Rank 1
answered on 28 Aug 2010, 11:21 AM
Yes it doesn't affect the actual width of column. I have the same problem. When header text is longer than column width, column width doesn't work.
Edit : after removing "white-space: nowrap;" and "height: 18px;" lines in "telerik.common.css". Header width and height properties work for me.
Edit : after removing "white-space: nowrap;" and "height: 18px;" lines in "telerik.common.css". Header width and height properties work for me.
0
-glenn-
Top achievements
Rank 1
answered on 25 Mar 2011, 09:31 PM
I had to do what Ibrahim did - modify the Telerik CSS. Is that the "proper" way of adjusting the column widths?
0
J Kerchner
Top achievements
Rank 1
answered on 24 May 2011, 05:58 PM
I was having the same problem with the widths not working. I fixed it by specifying the widths of all the columns except the last column. If I don't specify a width for the last column the grid will automatically size it, but all the other columns are sized properly.
0
Minip
Top achievements
Rank 1
answered on 25 May 2011, 07:56 AM
Try adding ".t-grid table { table-layout: fixed; }" to your CSS file.
It works for me.
It works for me.
0
charles
Top achievements
Rank 1
answered on 29 Aug 2011, 01:40 PM
I know this is an old thread, but I found it and it helped me, so i thought I might be able to save someone else some time.
Apparently, because the rows in the grid default to 100% width, and each cell fits to its necessary width, you have to leave at least one cell's width undefined or change the css of the grid itself. For me, most of my grids have at least one column with large text fields, so I can just leave that one's width undefined.
it does NOT have to be the last cell in the grid.
Doing this will give the CSS one cell to grow and all of the other cells don't feel the need to anymore.
Apparently, because the rows in the grid default to 100% width, and each cell fits to its necessary width, you have to leave at least one cell's width undefined or change the css of the grid itself. For me, most of my grids have at least one column with large text fields, so I can just leave that one's width undefined.
it does NOT have to be the last cell in the grid.
Doing this will give the CSS one cell to grow and all of the other cells don't feel the need to anymore.
0
FinallyInSeattle
Top achievements
Rank 1
answered on 29 Sep 2011, 07:59 PM
I had to use Minip's suggestion (".t-grid table { table-layout: fixed; }") on one of my grids that was overflowing its area when I added a DetailView. The header itself was being drawn outside it's container apparently due to the "expander column" being present. If I removed the DetailView, the grid rendered correctly. I do have a column that doesn't have a fixed width specified, but it wasn't enough to get rid of this problem.
0
Manish
Top achievements
Rank 1
answered on 17 Apr 2013, 07:20 PM
Brilliant Minip
!!! thank you so much. You solution worked for me. Although this should have worked out of the box. Telerik please fix this issue.