首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

怎么设置DataGridView的行标题

2011-12-12 
如何设置DataGridView的行标题我想问一下如何设置DataGridView行标题,可以把他设成CheckBox或文本,图片等

如何设置DataGridView的行标题
我想问一下如何设置DataGridView行标题,可以把他设成CheckBox或文本,图片等信息

[解决办法]
private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
if (e.ColumnIndex == -1 && e.RowIndex!=-1)
{
e.Handled = true;
e.PaintBackground(e.CellBounds, false);
ControlPaint.DrawCheckBox(e.Graphics, e.CellBounds, ButtonState.Checked);
}
}

热点排行