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

GridColumn IE Alignment Issues

3 Answers 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
digitall
Top achievements
Rank 1
digitall asked on 10 Jul 2009, 12:42 PM
We have a RadGrid on a page that has a first and last column and the columns in the middle are built dynamically based on some criteria. Everything works great and the edit mode is perfect with the exception of one thing - styling with IE. Everything in FF looks perfect and is exactly what we want and after a few tweaks we got it to work with IE8. Unfortunately, in compatibility mode the column alignments are not being honored. Here is what the structure looks like:

                GridNumericColumn col = new GridNumericColumn(); 
                GridTemplateColumnEditor Editor = new GridTemplateColumnEditor() { ID = "Editor" + FieldName }; 
 
                rgCalendar.Columns.Add(col); 
                phEditors.Controls.Add(Editor); 
 
                col.DataField = FieldName; 
                col.UniqueName = FieldName; 
                col.DataType = typeof(int); 
                col.HeaderText = ScrapType.Name; 
                col.ItemStyle.Width = Unit.Pixel(40); 
                col.ItemStyle.HorizontalAlign = HorizontalAlign.Right; 
                col.ColumnEditorID = Editor.ID; 
                col.HeaderStyle.Wrap = false
                col.HeaderStyle.HorizontalAlign = HorizontalAlign.Right; 
 

Does anyone have any suggestions as to what we can do to ensure the dynamic columns are always right-aligned cross-browser? We're using the default skin with the Q1 2009 release.

3 Answers, 1 is accepted

Sort by
0
digitall
Top achievements
Rank 1
answered on 10 Jul 2009, 12:50 PM
As often happens, I figured it out. The column width of 40px was being honored by IE even though the header (set to not wrap) was wider. So it was "right-aligned" in it's 40px wide cell instead of the cell just expanding all the way.
0
Dimo
Telerik team
answered on 10 Jul 2009, 02:43 PM
Hi digitall,

In addition, you should set column widths with HeaderStyle.Width, not ItemStyle.Width.

Greetings,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
digitall
Top achievements
Rank 1
answered on 10 Jul 2009, 03:32 PM
Actually, I won't know the width of the header as it is set to not wrap. Removing the ItemStyle width was sufficient though.

Thanks!
Tags
Grid
Asked by
digitall
Top achievements
Rank 1
Answers by
digitall
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or