Home > Code > C# > gridview header color

gridview header color

by San   on Jan 10, 2012   Category: C#   |  Views: 42    |  Points: 25   |  Bronze 



private void datagridview1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
if (e.RowIndex == -1)
{
Brush b = new TextureBrush(global::Textiles.Properties.Resources.image1);
e.Graphics.FillRectangle(b, e.CellBounds);
e.PaintContent(e.ClipBounds);
e.Handled = true;
}
}

Like this code? Bookmark and Share:

  User Responses | Post Code
 No Response found!
  Recent Posts
* Setting focus to textbox control using JavaScript (240) by Narain_Siddharth on Nov 13 2010 11:25AM
* Sending Mails with Attachements using Asp.Net (280) by Narain_Siddharth on Nov 13 2010 11:48AM
* Disable the Submit button when insert or update a record using JavaScript (198) by Narain_Siddharth on Nov 13 2010 12:31PM
* String comparisons using C#.NET string.compareTo (193) by Thamilselvanj on Nov 14 2010 11:16AM
* String.Split using C# (202) by Thamilselvanj on Nov 14 2010 11:23AM
  Submit feedback about this code snippet
Please sign in to post feedback