private void TSMI_RemoveField_Click(object sender, EventArgs e) { if (dataGridView1.SelectedColumns.Count == 0) { MessageBox.Show("Please select one field firstly!", "Alarm"); return; } int fieldIdx = dataGridView1.SelectedColumns[0].Index; string fieldName = dataGridView1.Columns[fieldIdx].Name; if (MessageBox.Show("Remove field: " + fieldName + "?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes) { _layer.EditDeleteField(fieldName); LoadDataTable(); m_ContentChanged = true; } }