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.
Syncfusion Feedback

Image in GroupCaptionCell

Thread ID:

Created:

Updated:

Platform:

Replies:

60337 May 2,2007 08:38 PM UTC May 2,2007 10:40 PM UTC Windows Forms 1
loading
Tags: Grouping
Andy
Asked On May 2, 2007 08:38 PM UTC

Syncfusion 4.4
VS 2005

I want to add an image(like an alert icon) to the GroupCaptionCell if a record in that group meets a specific criteria and then also set the image for the group's parent group groupcaptioncell.

Can someone help with this? Thanks

haneefm [Syncfusion]
Replied On May 2, 2007 10:40 PM UTC

Hi Shek,

If you want to draw the Exclamation mark on GroupCaption cell, you need to handle the TableControlDrawCell event of the grid and draw image using the Graphics.DrawImage method. Here is a code snippet.

private void gridGroupingControl1_TableControlDrawCell(object sender, GridTableControlDrawCellEventArgs e)
{
GridTableCellStyleInfo style = e.Inner.Style as GridTableCellStyleInfo;
if( style.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionCell )
{
Element el = style.TableCellIdentity.DisplayElement;
if( ! el.ParentGroup.IsMainGroup )
{
object category = el.ParentGroup.Category;
if( category != null)
{
e.Inner.Cancel = true;
Rectangle ImageRect= new Rectangle(e.Inner.Bounds.Location,new Size(20,e.Inner.Bounds.Height));
Rectangle TextRect= new Rectangle( new Point( e.Inner.Bounds.Location.X + 20,e.Inner.Bounds.Location.Y),
new Size(e.Inner.Bounds.Size.Width- 20,e.Inner.Bounds.Height));

e.Inner.Renderer.Draw(e.Inner.Graphics,TextRect,e.Inner.RowIndex,e.Inner.ColIndex,e.Inner.Style);
e.Inner.Graphics.DrawImage(SystemIcons.Exclamation.ToBitmap(),ImageRect);
}
}
}
}

Please refer to the attached sample for implementation.
GGCGroupCAtionImage.zip

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.

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

;