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

Grid Styles for GDBG

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?

Regards



1 Reply

RC Rajadurai C Syncfusion Team January 27, 2009 02:33 PM UTC

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.

Regards,
Rajadurai


Loader.
Live Chat Icon For mobile
Up arrow icon