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

[Solved] Column widths don't take effective if all set

3 Answers 109 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.
Wicky
Top achievements
Rank 1
Wicky asked on 13 Feb 2012, 04:33 AM
Hi,

I foud that if I set all columns' width, it will not take effective when view the grid.
For example, a simple two columns binding:

Case 1: (Column Code width is OK)
columns.Bound(x => x.Code).Width(100);
columns.Bound(x => x.Name);

Case 2: (Column Name width is OK)
columns.Bound(x => x.Code);
columns.Bound(x => x.Name).Width(100);

Case 3: (Columns' width are set to equal (half of grid width), not take effective)
columns.Bound(x => x.Code).Width(100);
columns.Bound(x => x.Name).Width(100);

Note: grid width is 100% of page, page width > 1000.

Regards
Wicky

3 Answers, 1 is accepted

Sort by
0
Rogerio
Top achievements
Rank 2
answered on 21 May 2012, 03:49 PM
Hi,

No answer for this ?
0
Dimo
Telerik team
answered on 22 May 2012, 10:04 AM
Hello Rogerio,

You can set widths to all Grid columns only if you are using Scrolling and the sum of all widths exceeds the width of the Grid component. This is the way to get a horizontal scrollbar. Otherwise if the widths are too small, the browser will expand all columns proportionately due to the 100% width style that is applied by design to the Grid <table> element.

If you wish to have two 100px wide Grid columns, then use a 200px-wide Grid. We do not support a scenario in which the sum of Grid column widths is "A", the Grid width is "B", and B > A.

Regards,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
Ganesh Jagdale
Top achievements
Rank 1
answered on 10 Sep 2012, 09:03 AM
Hi Telerik,
   How I can set column width in javascipt after grid loaded. Please let me know.
 
Thanks,
Ganesh
Tags
Grid
Asked by
Wicky
Top achievements
Rank 1
Answers by
Rogerio
Top achievements
Rank 2
Dimo
Telerik team
Ganesh Jagdale
Top achievements
Rank 1
Share this question
or