例如我想把DataGridView中的第4列的左边框网格线去掉,请高手指点,结案立即给分。
解决方案 »
- 截取字符串 比如 123124Tab123.2 其中用Tab键分开字符串
- 关于C# comboBox跟SQL绑定问题
- DX控件中Gridview点击NEW EDIT DELETE按钮 一直处于loading状态?
- (百分求助)C# Winform下数字转中文及排序问题。
- 提取指定网页中数据的方法
- 在c#中调用c++Build写的DLL,其中有参数为AnsiString类型,如何处理?
- Remoting高手请进,一个问题好头痛哦!请大家帮我看看吧。我想这个问题是个很高深的东东!!!!!!!!!!
- 读取XML文件后处理问题
- win7上vs2012从informix数据库读取中文数据显示乱码
- Serializa / Deserializa 菜问题
- 动态设置背景颜色BackColor,IE可以显示,谷歌、遨游等无法显示
- 求一个最简单的telnet命令发送程序
http://blog.csdn.net/scutliu/article/details/5643288
其余的设计自己想怎么控制就怎么控制了
if (e.RowIndex != -1 && e.ColumnIndex == 4)
{
Brush gridBrush = new SolidBrush(dataGridView1.GridColor);
using (Pen gridLinePen = new Pen(gridBrush))
{
e.Graphics.FillRectangle(new SolidBrush(Color.White), e.CellBounds);
e.Graphics.DrawLine(gridLinePen, e.CellBounds.Left,
e.CellBounds.Bottom - 1, e.CellBounds.Right,
e.CellBounds.Bottom - 1);
if (e.Value != null)
{
e.Graphics.DrawString((string)e.Value, e.CellStyle.Font, new SolidBrush(Color.Black), e.CellBounds.X + 2, e.CellBounds.Y + 5, StringFormat.GenericDefault);
}
}
e.Handled = true;
}代码