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.

Colors in a virtual grid

Thread ID:

Created:

Updated:

Platform:

Replies:

66609 Jul 31,2007 11:14 AM Jul 31,2007 11:37 AM Windows Forms 2
loading
Tags: GridControl
Lucia Diaconu
Asked On July 31, 2007 11:14 AM

Hi!

I have 2 questions regarding colors in a virtual grid:

1) I would like to have as row/column headers a simple gray color, not any skin. How could I do this?

2) I would like to color the text for some cells (the cells with null values, that display a minus sign (I would like a red minus sign :-) ) (I fill in this value in the QueryCellInfo event handler.

Can you give me a tip?

Thanks,
Lucia

Lucia Diaconu
Replied On July 31, 2007 11:35 AM

I found the needed property for the second question:
e.Style.TextColor = Color.Red;
So, only the first question remains :-)

Lucia

haneefm [Syncfusion]
Replied On July 31, 2007 11:37 AM

Hi Lucia,

In a virtual grid, if you want to change a header cell's backcolor, you have to do it by setting e.Style.BackColor ( also set e.Style.Themed property to false) in your QeryCellInfo handler.

void gridControl1_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if (e.RowIndex == 0 || e.ColIndex == 0)
{
e.Style.Themed = false;
e.Style.BackColor = SystemColors.GrayText;
}
}

Best regards,
Haneef

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.

;