7 February 2014

gridview header color in C#.net

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;
}
}

No comments:

Post a Comment