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.

Stylize the control GridDataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

119833 Aug 5,2015 11:28 PM Aug 6,2015 07:12 AM Windows Forms 1
loading
Tags: GridDataBoundGrid(Classic)
Claudemiro Batista
Asked On August 5, 2015 11:28 PM

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!!!

Adhikesevan Kothandaraman [Syncfusion]
Replied On August 6, 2015 07:12 AM

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.

CONFIRMATION

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.

;