给datagridview添加行数
来源:互联网 发布:原油指数软件 编辑:程序博客网 时间:2024/05/01 20:11
private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(e.RowBounds.Location.X,
e.RowBounds.Location.Y,
dataGridView1.RowHeadersWidth - 4,
e.RowBounds.Height);
TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(),
dataGridView1.RowHeadersDefaultCellStyle.Font,
rectangle,
dataGridView1.RowHeadersDefaultCellStyle.ForeColor,
TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
}
{
System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(e.RowBounds.Location.X,
e.RowBounds.Location.Y,
dataGridView1.RowHeadersWidth - 4,
e.RowBounds.Height);
TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(),
dataGridView1.RowHeadersDefaultCellStyle.Font,
rectangle,
dataGridView1.RowHeadersDefaultCellStyle.ForeColor,
TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
}
0 0
- 给datagridview添加行数
- datagridview 手动添加行数据
- DataGridView添加行数据并赋值
- 给DataGridView添加右键菜单
- 给DataGridView添加右键菜单
- C#----给DataGridView添加行号
- 用代码给DataGridView添加新行
- WinForm中给DataGridView添加 自动编号
- 给Winform中的datagridview添加行号
- 【代码示例】动态给HtmlTable添加行数据
- ●给DataGridView添加底部合计行的一种方法
- 给DataGridView添加底部合计行的一种方法
- ●给DataGridView添加底部合计行的一种方法
- 给datagridview添加右键菜单并确定其位置
- 给DataGridView添加底部合计行的一种方法[转载]
- 给DataGridView中的控件添加事件和下拉框
- C# winform 和Webform 给DataGridView 和DataView 添加行号
- 怎么给Datagridview里面的控件添加事件
- EXTJS 杂技
- leetcode226. Invert Binary Tree
- Redis安装使用教程
- debian中查找已安装软件及卸载软件
- 想写UInavibar
- 给datagridview添加行数
- oracle定时任务导数据库
- java 多线程之间的通信
- C++中临时对象及返回值优化
- 前端安全问题:CSRF
- HDU 5547(DFS)
- APP测试学习笔记1--android恶意代码分析
- Android Binder设计与实现(2) – 设计篇
- 三极管电路分析