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.

customize plus/minus button in group header rows

Thread ID:

Created:

Updated:

Platform:

Replies:

47429 Aug 4,2006 03:35 AM Aug 7,2006 08:27 AM Windows Forms 3
loading
Tags: Grouping
Mario
Asked On August 4, 2006 03:35 AM

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

Administrator [Syncfusion]
Replied On August 4, 2006 07:03 AM

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

Mario
Replied On August 4, 2006 10:06 AM

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

Administrator [Syncfusion]
Replied On August 7, 2006 08:27 AM

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

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.

;