C# DataGridView 在最左边的列显示行号
来源:互联网 发布:ec销售软件 编辑:程序博客网 时间:2024/05/01 10:26
// 显示DataGridView序号列
private void dgvData_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
DataGridView dgv = sender as DataGridView;
Rectangle rectangle = new Rectangle(e.RowBounds.Location.X,
e.RowBounds.Location.Y,
dgv.RowHeadersWidth - 4,
e.RowBounds.Height);
TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(),
dgv.RowHeadersDefaultCellStyle.Font,
rectangle,
dgv.RowHeadersDefaultCellStyle.ForeColor,
TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
}
private void dgvData_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
DataGridView dgv = sender as DataGridView;
Rectangle rectangle = new Rectangle(e.RowBounds.Location.X,
e.RowBounds.Location.Y,
dgv.RowHeadersWidth - 4,
e.RowBounds.Height);
TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(),
dgv.RowHeadersDefaultCellStyle.Font,
rectangle,
dgv.RowHeadersDefaultCellStyle.ForeColor,
TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
}
0 0
- C# DataGridView 在最左边的列显示行号
- C# DataGridView在HeaderCell中显示行号的方法
- C# DataGridView在HeaderCell中显示行号的方法
- C# datagridview显示行号
- c#中dataGridView显示行号的方法
- dvExpre 在GridView最左边的标题栏里写上当前行号
- C#中DataGridView显示行号
- C#中的datagridview显示行号
- C# DataGridView显示行号方法。
- 在DataGridView中显示行号
- C# 中 datagridview控件 在行标题显示行号的方法
- C# DataGridView显示行号的两种方法
- C# DataGridView显示行号的三种方法
- C# DataGridView显示行号的三种方法
- C# DataGridView显示行号的三种方法
- 将datagridview中某一列在最右端显示
- C# winfrom中 DataGridView中显示行号
- C# DataGridView显示行号、行选中
- 关于http的post传送文件
- 数据结构实验之链表四:有序链表的归并
- Log Processing With Storm
- Hadoop学习笔记(2)
- cocos2dx 3d开源项目 fantasyWarrior3D 从零走起 6完结 [AttackManager&GameMaster]
- C# DataGridView 在最左边的列显示行号
- 算法学习 - Gray Code(格雷码)的解释和c++实现
- BLAS loading error:
- nodejs学习心得
- 【leetcode】Palindrome Number
- BLAS loading error:
- 再探C++数组的size可以是变量
- dec 9
- poj 3259 最短路