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

Stylize the control GridDataBoundGrid

Hi!

I would like to know how can I to stylize the control GridDataBoundGrid.
1. I want to remove the sign that stay on left side indicating the line; I put width = 0, but I don't know if is rigth.
2. I want to apply Metro style
3. I want to alternately paint the lines (is possible?)

Please, send some sample about.


Thanks!!!

1 Reply

AK Adhikesevan Kothandaraman Syncfusion Team August 6, 2015 11:12 AM UTC

Hi Claudemiro,

Thank you for your interest in Syncfusion products.


Query-1
I want to remove the sign that stay on left side indicating the line;

In order to hide the row headers,you can use the ShowRowHeaders property.

Code Snippet:
//To hide the RowHeaders
gridDataBoundGrid1.ShowRowHeaders = false;

Query-2
I want to apply Metro style


If you want to apply the theme to grid, you need to enable the ThemesEnabled property and then you can set theme using GridVisualStyles.

Code Snippet:
//To apply the Metro style for GridDataBoundGrid.
gridDataBoundGrid1.ThemesEnabled = true;
gridDataBoundGrid1.GridVisualStyles = Syncfusion.Windows.Forms.GridVisualStyles.Metro;

UG:
http://help.syncfusion.com/ug/windows%20forms/Documents/howtoenablecolorstylesettingsinwindowsgrids.htm

Query-3
I want to alternately paint the lines (is possible?)


The backcolor and textcolor of alternate rows can be customized using QueryCellInfo event. Please make use of below code,

Code Snippet:
//Invoke QueryCellInfo
gridDataBoundGrid1.Model.QueryCellInfo += new Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventHandler(Model_QueryCellInfo);

//QueryCellInfo Event Handler
void Model_QueryCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs e)
{
    if (e.Style.CellType != "ColumnHeaderCell" && (e.RowIndex % 2 == 0))
        e.Style.BackColor = Color.LightPink;
    else
        e.Style.BackColor = Color.GhostWhite;
}
UG:
http://help.syncfusion.com/ug/windows%20forms/Documents/querycellinfoevent.htm


Sample:
http://www.syncfusion.com/downloads/support/forum/119833/ze/GDBG-119833-1327660016

Please let me know if you have any concerns.

Regards,
Adhi.

Loader.
Live Chat Icon For mobile
Up arrow icon