private void TSMI_RenameField_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; frmInputBox aInputBox = new frmInputBox("Please input new field nameļ¼", "Change field name", fieldName); if (aInputBox.ShowDialog() == DialogResult.OK) { string aNewName = aInputBox.Value; if (aNewName == string.Empty) { MessageBox.Show("Field name is empty!", "Error"); return; } List <string> FNList = GetFieldNameLsit(); if (FNList.Contains(aNewName)) { MessageBox.Show("Field name has exist in the data table!", "Error"); return; } _layer.EditRenameField(fieldName, aNewName); LoadDataTable(); } }