斑竹帮看看,怎么解决?
namespace Sample_22{
partial class DGVForm
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.dgvData = new System.Windows.Forms.DataGridView();
this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Email = new System.Windows.Forms.DataGridViewTextBoxColumn();
(()(this.dgvData)).BeginInit();
this.SuspendLayout();
//
// dgvData
//
this.dgvData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvData.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.ID,
this.Name,
this.Email});
this.dgvData.Location = new System.Drawing.Point(2, 0);
this.dgvData.Name = "dgvData";
this.dgvData.RowTemplate.Height = 23;
this.dgvData.Size = new System.Drawing.Size(434, 272);
this.dgvData.TabIndex = 0;
this.dgvData.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvData_CellContentClick);
//
// ID
//
this.ID.HeaderText = "ID";
this.ID.Name = "ID";
//
// Name
//
this.Name.HeaderText = "Name";
this.Name.Name = "Name";
//
//
this.Email.HeaderText = "Email";
this.Email.Name = "Email";
//
// DGVForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(520, 301);
this.Controls.Add(this.dgvData);
this.Name = "DGVForm";
this.Text = "数据网格视图控件";
this.Load += new System.EventHandler(this.DGVForm_Load);
(()(this.dgvData)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView dgvData;
private System.Windows.Forms.DataGridViewTextBoxColumn ID;
private System.Windows.Forms.DataGridViewTextBoxColumn Name;
private System.Windows.Forms.DataGridViewTextBoxColumn Email;
}
错误有两处:
警告 1 “Sample_22.DGVForm.Name”隐藏了继承的成员“System.Windows.Forms.Control.Name”。如果是有意隐藏,请使用关键字 new。
错误 2 无法将类型“string”隐式转换为“System.Windows.Forms.DataGridViewTextBoxColumn”