The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi - I need to format the colum header cells of in a grouped grid to have a gradient style.
I have tried the following code (modified from code which I used in the bound grid) however it doesn''t seem to work. Strangely enough, the ''bold'' statement works fine, but the interior setting is ignored.
private void grItems_TableControlPrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlPrepareViewStyleInfoEventArgs e)
{
if (e.Inner.ColIndex==0)
{
e.Inner.Style.Interior = new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.Horizontal, Color.FromArgb(203, 199, 184), Color.FromArgb(238, 234, 216)); // This does not work
}
if (e.Inner.RowIndex==1)
{
e.Inner.Style.Font.Bold = true; // This works...
e.Inner.Style.Interior = new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.Horizontal, Color.FromArgb(203, 199, 184), Color.FromArgb(238, 234, 216)); // This does not work
}
}
I then tried to use the ''preview and edit'' feature (which is fantastic by the way!). I played with tabledescriptor.appearance.ColumnHeaderCell.interior however to no avail.
I then tried anyheadercell as well...
Could someone please tell me what I''m doing wrong?
Thanks very much in advance,
Damien Sawyer
ADAdministrator Syncfusion Team August 29, 2005 12:04 AM UTC
Are you seeing themed header cells? If so, that is why setting backcolor is not working. Try also setting e.Inner.Style.Themed = false.
Or, you can try this code in Form.Load.
this.gridGroupingControl1.TableDescriptor.Appearance.ColumnHeaderCell.Interior
= new BrushInfo(GradientStyle.Vertical, Color.Red, Color.Blue);
this.gridGroupingControl1.TableDescriptor.Appearance.ColumnHeaderCell.Themed = false;