throw InvalidOperationException , when I changed the value of the cell to update and immediately click on the menu item to open a new Winform.
private void dgv_category_CellValueChanged(object sender, DataGridViewCellEventArgs e) { DataTable dt = new DataTable(); dt = u.operationOnDataBase(sqlquery_selectCategory, 3); if (dt.Rows.Count > 0) { MessageBox.Show("Category Already Exist..."); } else { u.operationOnDataBase(sqlquery_UpdateCategory, 1); u.SyncMaster("update", "CategoryDetails", 0, Convert.ToInt32(dgv_category[1, e.RowIndex].Value.ToString()));
Exception - the operation is invalid because it leads to a repeated call to the SetCurrentCellAddressCore function.
in System.Windows.Forms.DataGridView.SetCurrentCellAddressCore (Int32 columnIndex, Int32 rowIndex, Boolean setAnchorCellAddress, Boolean validateCurrentCell, Boolean viaMouseClick) with System.Windows.Forms.DataGridView.set_Curcode.DataGormCellCellCourceCormCellCellCellCellCellCellCellCellCellCellCellCenterCellConnect (object value)
source share