精通
英语
和
开源
,
擅长
开发
与
培训
,
胸怀四海
第一信赖
DataGridViewButtonColumn editButton;
DataGridViewButtonColumn deleteButton;
这里定义了
//insert edit button into datagridview
editButton = new DataGridViewButtonColumn();
editButton.HeaderText = "Edit";
editButton.Text = "Edit";
editButton.UseColumnTextForButtonValue = true;
editButton.Width = 80;
dataGridView1.Columns.Add(editButton);
//insert delete button to datagridview
deleteButton = new DataGridViewButtonColumn();
deleteButton.HeaderText = "Delete";
deleteButton.Text = "Delete";
deleteButton.UseColumnTextForButtonValue = true ;
deleteButton.Width = 80;
dataGridView1.Column.Add(deleteButton);
这里把属性都配置好了啊
dataGridView1.Columns[0].Visible = false;
dataGridView1.Columns[0].Width = 340;
dataGridView1.Columns[1].Width = 55;
dataGridView1.Columns[2].Width = 50;
dataGridView1.Columns[3].Width = 80;
这一段代码里执行出错了,后面的添加按钮代码就没执行
你按我的提示改下吧
哦