【发布时间】:2013-01-28 06:49:21
【问题描述】:
我已经看到this 的问题,并将CellBorderStyle 设置为None,但由于某种原因,我的DataGridView 上仍有网格线:
这是我用来初始化控件的代码:
public FtpTransferGridView()
{
this.AutoGenerateColumns = false;
this.DoubleBuffered = true;
this.ReadOnly = true;
this.AllowUserToAddRows = false;
this.AllowUserToDeleteRows = false;
this.AllowUserToResizeRows = false;
this.ShowEditingIcon = false;
this.RowHeadersVisible = false;
this.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
this.AlternatingRowsDefaultCellStyle.BackColor = System.Drawing.Color.FromArgb(240, 240, 225);
this.RowTemplate.Height = 20;
this.CellBorderStyle = DataGridViewCellBorderStyle.None;
this.BackgroundColor = System.Drawing.SystemColors.Window;
InitializeColumns();
}
我在这里错过了什么?
【问题讨论】:
-
你试过
dataGridView1.AdvancedCellBorderStyle.All = DataGridViewAdvancedCellBorderStyle.None; -
@V4Vendetta 是的,我做到了,但没有帮助。请参阅我的答案以了解问题所在。
标签: c# winforms datagridview .net-2.0