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

Q109 Grid Background colors

1 Answer 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
SonicImaging
Top achievements
Rank 1
SonicImaging asked on 18 Mar 2009, 08:37 PM
Hi,   I have a RadGrid created completely in code behind.  After switching to the new skins the following is happening.

Some columns including the header show up in a different color then specified here

        RG1.AlternatingItemStyle.BackColor = System.Drawing.Color.Snow;
        RG1.ItemStyle.BackColor =  System.Drawing.Color.White;

For example only the ID column header background is dark gray then all the rows in the data are light and dark gray just for that column.  The rest of the rows are the proper colors defined above.  It happens on all the id fields.

I thought id might be because that column is set readonly = true but if I set it to false its dark grey

The rest of the column headers are the correct color , White and the AlternatingItemStyle Snow.  But if I change skins it does it on all of them

What would be changing the color of the id field?

        boundColumn = new GridBoundColumn(); 
        boundColumn.DataField = "id"
        boundColumn.HeaderText = "ID"
        boundColumn.UniqueName = "id"
        boundColumn.HeaderStyle.Width = Unit.Pixel(15); 
        boundColumn.ItemStyle.Width = Unit.Pixel(15); 
        boundColumn.FooterStyle.Width = Unit.Pixel(15); 
        boundColumn.Display = true
        boundColumn.Visible = true
        boundColumn.ReadOnly = true
        boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center; 
        boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center; 
        boundColumn.FooterStyle.HorizontalAlign = HorizontalAlign.Center; 
        RG1.MasterTableView.Columns.Add(boundColumn); 



1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 19 Mar 2009, 09:50 AM
Hi SonicImaging,

This is one of the new features of RadGrid - automatic styling of sorted columns.

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/sort/defaultcs.aspx

If you prefer not to have it, you can disable it in the control's SortingSettings - the property is called EnableSkinSortStyles.

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.
Tags
Grid
Asked by
SonicImaging
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or