dataGridView如何才能让每行前边加上系统给的序号呢?我说的不是数据库中的自动编号,是每行前边的序号123456789
解决方案 »
- 用vs2010设计窗体,怎么让窗体启动时出现声音,就像酷狗音乐那样?
- 为什么引用的项目不能生成DLL
- 请问c#怎么做调色板?
- ListView二次自定义扩展开发,需要一个全选的checkbox列和HyperLink列,请前辈指点下方面,小弟先感谢了!
- 客户端调用存储过程时有的机器没反应,有的正常....急急急...求解
- 导致“未能加载程序集“App_Web_oi3vklbf”。请确保在访问该页之前已经编译了此程序集” 之FTP借鉴篇
- 急需回答
- DropDownList绑定数据问题!!谢谢各位
- 【下载】Visual Studio 2005 Enterprise Architect Beta 1 (8CD) 大家快来加速!
- 关于DATALIST的ITEM属性的问题
- 如何通过分析网页源代码获取想要的数据?
- 数据库问题相信碰到的人都会头痛~~~~ 如何编写程序 对数据库操作做 记录
http://www.codeproject.com/books/PresentDataDataGridView.asp中的“Utilizing Cell-Oriented Grid Features”这部分。
private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
using (SolidBrush b = new SolidBrush(dataGridView1.RowHeadersDefaultCellStyle.ForeColor))
{
e.Graphics.DrawString(e.RowIndex.ToString(System.Globalization.CultureInfo.CurrentUICulture), e.InheritedRowStyle.Font, b, e.RowBounds.Location.X + 20, e.RowBounds.Location.Y + 4);
}
}