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

Setting interior for groupedgrid

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

1 Reply

AD Administrator 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;

Loader.
Live Chat Icon For mobile
Up arrow icon