Reputation: 19
I'm working on WinForms project. I need to change color of radGrid header from blue to green. every thing that I found, is about Web not Windows Forms.
Can any one please tell me how this can be achieved?
Thanks
Upvotes: 1
Views: 4634
Reputation: 411
Heres what I use for what its worth.
in code objects edit like this.rgDailyResults.HeaderStyle =color.green or else you have tags in web and forms that control them like so:
<telerik:RadGrid ID="rgScenarioRollUps" AllowMultiRowSelection="True" AllowPaging="False" AllowSorting="False" Width="100px" AutoGenerateColumns="false" runat="server" Skin="">
<HeaderStyle CssClass="propGridHeader" />
<AlternatingItemStyle CssClass="propDarkGrid" />
<ItemStyle CssClass="propLightGrid" />
<SelectedItemStyle CssClass="propSelected" />
Edit This is what you wanted from telerik
http://www.telerik.com/help/winforms/
the latter link explains changing the "header image"
Upvotes: 2
Reputation: 4455
Try something like this:
C#
protected void radGrid_ItemDatabound(object sender, GridItemDataBoundEventArgs e)
{
if (e.Item is GridHeaderItem)
{
var item = e.Item as GridHeaderItem;
item.BackColor = Color.Green;
}
}
ASPX:
<telerik:RadGrid ID="radGrid" runat="server" OnItemDataBound="radGrid_ItemDatabound">
[...]
</telerik:RadGrid>
Upvotes: 0
Reputation: 4648
Try
GridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.Purple;
Upvotes: 0