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

customize plus/minus button in group header rows

I am working with a GridGroupingControl of the current version. The enclosed images show what I try to achieve and what I currently have.

How can I draw images beneath the plus/minus button in the group header row to show open/closed folder bitmaps?

And how can I customize the plus/minus button to have the neat 3D appearance shown in the attached image?

Thanks for your help.


Images12.zip

3 Replies

AD Administrator Syncfusion Team August 4, 2006 11:03 AM UTC

Hi Mario,

You can use the TableControlDrawCell event to customize the images that appear in the PlusMinus cell, when there are nested tables/nested groups as shown in the following code snippet:

private void gridGroupingControl1_TableControlDrawCell(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlDrawCellEventArgs e)
{
GridTableCellStyleInfo info = e.Inner.Style as GridTableCellStyleInfo;
if( info.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionPlusMinusCell )
{
e.Inner.Renderer.Draw(e.Inner.Graphics,e.Inner.Bounds,e.Inner.RowIndex,e.Inner.ColIndex,e.Inner.Style); e.Inner.Cancel = true;
if( e.Inner.Style.Description == "+" )
{
e.Inner.Graphics.DrawImage("myplusImagewithFolder",e.Inner.Bounds);
}
else
{
e.Inner.Graphics.DrawImage("myminusImagewithFolder",e.Inner.Bounds);
}
}
}

For 3D appearance :

You need to set the theme enable property of the Grid or GroupCaptionPlusMinusCell cell in a grid. Please find the code snippet below.

this.grid.TableDescriptor.Appearance.GroupCaptionPlusMinusCell.Themed = true;

Thanks
Haneef


MA Mario August 4, 2006 02:06 PM UTC

Hi Haneef,
thanks for your help. I would like to have my application look the same, whether it is running under XP or under another os. Therefore, I don''t feel good with using the Themed property. This addresses the XP Themes mechanism, doesn''t it?

Does the GroupingGridControl not provide it''s own themes to have a controls appear in a 3D style?

Regards, Mario


>Hi Mario,

You can use the TableControlDrawCell event to customize the images that appear in the PlusMinus cell, when there are nested tables/nested groups as shown in the following code snippet:

private void gridGroupingControl1_TableControlDrawCell(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlDrawCellEventArgs e)
{
GridTableCellStyleInfo info = e.Inner.Style as GridTableCellStyleInfo;
if( info.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionPlusMinusCell )
{
e.Inner.Renderer.Draw(e.Inner.Graphics,e.Inner.Bounds,e.Inner.RowIndex,e.Inner.ColIndex,e.Inner.Style); e.Inner.Cancel = true;
if( e.Inner.Style.Description == "+" )
{
e.Inner.Graphics.DrawImage("myplusImagewithFolder",e.Inner.Bounds);
}
else
{
e.Inner.Graphics.DrawImage("myminusImagewithFolder",e.Inner.Bounds);
}
}
}

For 3D appearance :

You need to set the theme enable property of the Grid or GroupCaptionPlusMinusCell cell in a grid. Please find the code snippet below.

this.grid.TableDescriptor.Appearance.GroupCaptionPlusMinusCell.Themed = true;

Thanks
Haneef


AD Administrator Syncfusion Team August 7, 2006 12:27 PM UTC

Hi Mario,

Right now, our grids does not have any own themes.
You can also set the gradient style for background using the interior style property. Below is the sample link.
http://www.syncfusion.com/Support/user/uploads/GridAppearance_e3b1ac5e.zip

Thanks,
Rajagopal

Loader.
Live Chat Icon For mobile
Up arrow icon