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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Giving PlusMinus buttons a different color (GridGroupingControl)

Thread ID:





70646 Dec 21,2007 02:39 PM UTC Dec 27,2007 05:11 PM UTC WinForms 1
Tags: Grouping
Anne Thorne
Asked On December 21, 2007 02:39 PM UTC

Hello Again,

Yesterday I spent about an hour trying to get the PlusMinus buttons a different color, not a different theme, but a differnt color -- we would like to use a dark blue (System.Drawing.Color.FromArgb(123, 134, 154))
to match the color scheme of our windows application.

Is this possible, I cannot see any examples of this being done in any of your work.

For instance, the following link shows only a themed PlusMinus button:


Thank you so much for all of the help you give us all.
:) Anne at Arbonne.com

haneefm [Syncfusion]
Replied On December 27, 2007 05:11 PM UTC

Hi Anne,

You need to subscribe to the grid's TableControlDrawCell event for drawing the cells. There you can use e.Inner.Graphics.FillRectanlge to draw the backcolor and then set e.Inner.Cancel = true to indicate you have handled the drawing. Below are the codes:

void gridGroupingControl1_TableControlDrawCell(object sender, GridTableControlDrawCellEventArgs e)
GridTableCellStyleInfo style = e.Inner.Style as GridTableCellStyleInfo;
if (style.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionPlusMinusCell)
e.Inner.Cancel = true;
e.Inner.Graphics.FillRectangle(new SolidBrush(Color.Red), e.Inner.Bounds);
e.Inner.Graphics.DrawRectangle(Pens.Black, e.Inner.Bounds);
Element el = style.TableCellIdentity.DisplayElement;
string text = el.ParentGroup.IsExpanded ?"-":"+";
e.Inner.Graphics.DrawString(text, e.Inner.Style.GdipFont, new SolidBrush(e.Inner.Style.TextColor), new Point( e.Inner.Bounds.X + 5,e.Inner.Bounds.Y +5) );

Best regards,


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon