We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

virtualGrid and header BackColor

Hi,

I have a virtual grid. I am setting the HeaderBackColor to Custom color in PreviewViewStyleInfo.

protected override void OnPrepareViewStyleInfo(GridPrepareViewStyleInfoEventArgs e)
{
base.OnPrepareViewStyleInfo(e);
if (e.RowIndex == 0)
{
e.Style.BackColor = this.HeaderBackColor;
e.Style.TextColor = this.HeaderForeColor;
}

//This doesn't change header settings
if (_styler != null)
{
_styler.SetInfo(e.RowIndex, e.ColIndex, e.Style);
}
else
{
if (e.RowIndex != 0 && _hilightAlternateRows && e.RowIndex % 2 == 0)
e.Style.BackColor = this.HilightAlternateRowColor;
}

//To highlight the whole row when the current cell is being displayed.
if (this.Model.Selections.Count > 0 && e.RowIndex > this.Model.Rows.HeaderCount && e.ColIndex > this.Model.Cols.HeaderCount && this.CurrentCell.HasCurrentCellAt(e.RowIndex))
{
e.Style.Interior = new BrushInfo(SystemColors.Highlight);
e.Style.TextColor = SystemColors.HighlightText;
//e.Style.Font.Bold = true;
}
}

Only TextColor is having effect. The back color settings doen't have any effect. Kindly let me know how to set the header back color to the desired color. This color can be changed at runtime. Thanks.

Regards
kiran



2 Replies

AD Administrator Syncfusion Team March 20, 2007 05:12 PM UTC

Hi Kiran,

Try setting the Style.Themed to false to see if that takes care of the issue.

Best regards,
Haneef


AD Administrator Syncfusion Team March 21, 2007 05:08 AM UTC

It worked. Thanks!

Regards
Kiran

Loader.
Live Chat Icon For mobile
Up arrow icon