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

Column Widths Illogical With Static Headers

1 Answer 72 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Justavian
Top achievements
Rank 1
Justavian asked on 02 Dec 2010, 06:55 PM
I read a lot of posts relating to column widths, but i didn't come across what i was looking for.  Please forgive me if this is a repost.

I have a problem that can be quite clearly seen in the Scrolling demo here:
http://demos.telerik.com/aspnet-ajax/grid/examples/client/scrolling/defaultcs.aspx

Turn the static headers on and off and watch the sizes of the columns.

When i have the client scrolling + static headers turned on, my grid no longer automatically sizes the columns in a reasonable way.  I have a grid with a number of very small columns, and a couple of large descriptive ones.  With scrolling and static headers off, it looks great.  The big descriptive columns take up the majority of the space, and the smaller columns are allocated almost nothing - tight around the data.

As soon as static headers + scrolling is on, the widths are almost random.  The description columns will now only get *slightly* more than others - and none of the columns are tight around the data.  When the description fields are shrunk down, they wrap such that each row is now giant - it makes it basically unreadable.

Bottom Line:
Is there any possible way i can do something to maintain the great auto sizing, but still get static headers + scrolling?

-RP


EDIT: i feel like i should probably point out that i cannot hard code my column widths here - not even in percentages.  The number of columns being displayed, as well as the data contained within, will vary greatly.  The default auto sizing handles that perfectly, but is upset by the static + scroll.

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 03 Dec 2010, 09:21 AM
Hi Justavian,

In the online demo that you are referring to, the RadGrid columns have a width setting of 200px. However, it is not applied when scrolling is disabled, because the RadGrid control is narrower, so the columns are shrunk by the browser. On the other hand, when scrolling is enabled, there is an infinite amount of space for the columns to fit in.

I believe the following information will throw some more light on using column widths:

http://www.telerik.com/community/forums/aspnet/grid/best-practice-for-grid-and-column-widths.aspx#1214355


Regards,
Dimo
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Justavian
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or