//添加按钮列
dataGridView1.Controls.Clear();
DataGridViewButtonColumn buttonColumn = new DataGridViewButtonColumn();
buttonColumn.HeaderText = "";
buttonColumn.Text = "文本";
buttonColumn.UseColumnTextForButtonValue = true;
buttonColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
buttonColumn.FlatStyle = FlatStyle.Standard;
buttonColumn.CellTemplate.Style.BackColor = Color.Honeydew;
buttonColumn.DisplayIndex = 0;
dataGridView1.Columns.Add(buttonColumn);
//Viusal Studio 2008为dataGridView绑定数据
BindingSource bs = new BindingSource();
bs.DataSource = dataSet.Tables[0];
dataGridView1.DataSource =bs;
//设置dataGridView的头信息
dataGridView1.Columns[0].HeaderText =“”;
//设置dataGridView1所有单元格禁止编辑
dataGridView1.ReadOnly = true;
//取消行前面的小三角符号,取消行选择
dataGridView1.RowHeadersVisible = false;
//消除最后一行空行
dataGridView1.AllowUserToAddRows = false;