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.
Unfortunately, activation email could not send to your email. Please try again.

Grid Styles for GDBG

Thread ID:





79237 Jan 26,2009 12:07 PM Jan 27,2009 09:33 AM Windows Forms 1
Tags: GridControl
Nassim Farhat
Asked On January 26, 2009 12:07 PM

Hello Syncfusion team,

I have 2 project, in 1 project i use the gridgrouping control with the following appearance properties:

this._grid.Appearance.ColumnHeaderCell.TextColor = System.Drawing.Color.White;
this._grid.Appearance.TopLeftHeaderCell.Interior = new Syncfusion.Drawing.BrushInfo(System.Drawing.SystemColors.Desktop);
this._grid.Appearance.RowHeaderCell.Interior = new Syncfusion.Drawing.BrushInfo(System.Drawing.SystemColors.Desktop);
this._grid.Appearance.ColumnHeaderCell.Interior = new Syncfusion.Drawing.BrushInfo(System.Drawing.SystemColors.Desktop);
this._grid.Appearance.AlternateRecordFieldCell.Interior = new Syncfusion.Drawing.BrushInfo(System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(214)))), ((int)(((byte)(233))))));
this._grid.Appearance.FilterBarCell.Interior = new Syncfusion.Drawing.BrushInfo(System.Drawing.Color.FromArgb(((int)(((byte)(184)))), ((int)(((byte)(220)))), ((int)(((byte)(233))))));
this._grid.Appearance.AddNewRecordFieldCell.Interior = new Syncfusion.Drawing.BrushInfo(System.Drawing.Color.FromArgb(((int)(((byte)(184)))), ((int)(((byte)(220)))), ((int)(((byte)(233))))));

Now I am trying to replicate the exact same styles for a GridDataBoundGrid, unfortunately the property names for GDBG are not the same.

Can someone please tell me what are the same properties i can use to obtain the same result for GDBG as i did for Gridgrouping above?


Rajadurai C [Syncfusion]
Replied On January 27, 2009 09:33 AM

Hi Nassim,

Thanks for your interest in Syncfusion products.

The styles which are achieved from the above code in gridgroupingcontrol, can be achived in griddataboundgrid with the following code by handling PrepareViewStyleInfo event.

void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
if (e.RowIndex == 0 && e.ColIndex > 0)
e.Style.TextColor = Color.White;
e.Style.Interior = new Syncfusion.Drawing.BrushInfo(System.Drawing.SystemColors.Desktop);
if (e.RowIndex > 0)
if(e.RowIndex %2==0)
e.Style.Interior = new Syncfusion.Drawing.BrushInfo(System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(214)))), ((int)(((byte)(233))))));

Set ThemesEnabled property to true to get these styles applied to grid.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.