请问我下面这段代码有什么问题,如果不对应该怎么做
DataGridTextBoxColumn dgvtxb = new DataGridTextBoxColumn();
dgvtxb.HeaderText = "姓名";
dataGridView1.Columns.Add(dgvtxb);
前两行没问题,第三行报2个错
与“System.Windows.Forms.DataGridViewColumnCollection.Add(System.Windows.Forms.DataGridViewColumn)”最匹配的重载方法具有一些无效参数 E:\c#\WindowsFormsApplication8\WindowsFormsApplication8\Form1.cs 30
参数“1”: 无法从“System.Windows.Forms.DataGridTextBoxColumn”转换为“System.Windows.Forms.DataGridViewColumn” E:\c#\WindowsFormsApplication8\WindowsFormsApplication8\Form1.cs 30
而且看到网上很多人都可以做 dgvtxb.Name = "aaa" 这样的操作,我的根本没有 Name这个属性,是我的vs2008有问题?
------解决思路----------------------
DataGridViewTextBoxColumn