private void dataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { DataGridViewColumn column = dataGridView.Columns[e.ColumnIndex]; if (column is DataGridViewButtonColumn && column.Name == "edit") { ConfigInfo configInfo = ConfigCache.configInfos[e.RowIndex]; AddConfig addConfig = new AddConfig(this, configInfo, e.RowIndex); addConfig.Show(); } else if (column is DataGridViewButtonColumn && column.Name == "delete") { ConfigCache.configInfosBind.RemoveAt(e.RowIndex); ConfigCache.saveConfigToFile(); } } }
private void addConfig_Click(object sender, EventArgs e) { AddConfig addConfig = new AddConfig(this, new ConfigInfo(), -1); addConfig.Show(); }