怎样在DataGridView最前面加一列序号列? RT = ? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果用代码给DGV添加数据的话,自动会有序列号,如果你手动给DGV添加一些列的话,就没有序列号。 序列号?是行号吗?private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e){ Rectangle rectangle = new Rectangle(e.RowBounds.Location.X, e.RowBounds.Location.Y,dataGridView1.RowHeadersWidth, e.RowBounds.Height); TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(), dataGridView1.RowHeadersDefaultCellStyle.Font, rectangle, dataGridView1.RowHeadersDefaultCellStyle.ForeColor, TextFormatFlags.VerticalCenter | TextFormatFlags.Right);} SELECT 序号= (SELECT COUNT(UserID) FROM UserStore AS a WHERE a.UserID <= b.UserID), UserName as 客户名 FROM UserStore AS b ORDER BY 序号 NND,分给错人了.sf的分应该要给bd的. [toni_308]:我另外开了一贴,你来拿分吧. winform的datetimepicker控件能否显示农历,或者有什么解决方案么? 如何在WINFORM里得到选取的EXCEL的值 问一个很简单的问题: 对象的值和实例 求救!oracle 中通过c#语句更新数据库不能实现的问题 ZedGraph曲线不够平滑 asp.net/c#怎么做在线直播和在线视频对话 关于LOCK的问题! 第一个解决者得分! 和大家讨论一个关于继承的技术问题 cab文件压缩 关于SQL添加的一个简单的问题 C#可以支持GPS地图吗?
是行号吗?private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
Rectangle rectangle = new Rectangle(e.RowBounds.Location.X, e.RowBounds.Location.Y,dataGridView1.RowHeadersWidth, e.RowBounds.Height); TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(), dataGridView1.RowHeadersDefaultCellStyle.Font, rectangle, dataGridView1.RowHeadersDefaultCellStyle.ForeColor,
TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
}