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.zipBest regards,
Haneef