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

tile column header background images

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 tile background images for column headers? GridBackgroundImageMode only allows me to stretch or center the image.

Thanks for your help.




Images10.zip

1 Reply

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

Hi Mario,

There is no built-in support for this. You can use the TableControlDrawCell event to customize the images that appear in the ColumnHeader cell in a gris. Here is a code snippet:

GridTableCellStyleInfo info = e.Inner.Style as GridTableCellStyleInfo;
if( info.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell )
{
e.Inner.Renderer.Draw(e.Inner.Graphics,e.Inner.Bounds,e.Inner.RowIndex,e.Inner.ColIndex,e.Inner.Style);
e.Inner.Cancel = true;
Image image = "Your Image: //////SystemIcons.Exclamation.ToBitmap();
TextureBrush tBrush = new TextureBrush(image);
Pen blackPen = new Pen(Color.Black);
e.Inner .Graphics.FillRectangle(tBrush, e.Inner.Bounds );
e.Inner.Graphics.DrawRectangle(blackPen, e.Inner.Bounds );
//If you want to show the Header Text cleary ..... try use the DrawString method.

}

Thanks
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon