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

Column width not working

5 Answers 537 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kim
Top achievements
Rank 1
Kim asked on 25 Jun 2014, 04:41 PM
I have a grid with 4 levels of detail tables. I have not set the width of the grid, but have specified the width of every column using the HeaderStyle width. I also set TableLayout="Fixed" on the MasterTableView. However, the column widths don't seem to match the widths that I specified. The first level (the one that appears when the grid initially loads) is showing the correct column widths, plus 16. So if I specified 85px for a column, it shows up as 101px. The second level has the same issue. The third level seems to be doing something else altogether, ignoring the specific width of the first column and automatically adjusting the others. The first column's heading and data field are being set in the code behind, along with the width. Is this a known issue?

5 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 30 Jun 2014, 02:18 PM
Hello Kim,

To prevent the described problem you should make sure that the total width of the columns (either auto-generated or declaratively set) is equal to the grid width. Another option would be to leave one column without width in order to compensate the difference and the width of the columns should apply correctly.

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Kim
Top achievements
Rank 1
answered on 01 Jul 2014, 06:33 PM
As I said, I did not set a grid width. Is a width required?
0
Pavlina
Telerik team
answered on 04 Jul 2014, 02:31 PM
Hello Kim,

May I ask you to provide a live URL where the described issue can be observed. We will inspect it locally and will get back to you with additional information. Also specify which is the browser you are using and confirm that the version of Telerik.Web.UI for ASP.NET AJAX is 2014.2.618.

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Kim
Top achievements
Rank 1
answered on 07 Jul 2014, 01:10 PM
This is an intranet application so I can't provide a link. 
0
Pavlina
Telerik team
answered on 10 Jul 2014, 01:33 PM
Hello Kim,

If all columns have a fixed pixel width, then the sum of all widths must match the RadGrid width, otherwise the columns expand to fill up the available space. In such cases it is good to leave one column without a width (e.g. the last one), so that it can adjust automatically. This is valid for grid without scrolling.

If you have scrolling enabled for the grid it is not needed to set fixed width for the grid because the mastertableview is with fixed layout and it is enough to declare HeaderStyle.Width for the columns.

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Kim
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Kim
Top achievements
Rank 1
Share this question
or