private void InterfacesGrid_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e) { if (e.ColumnIndex != 8) { return; } System.Windows.Forms.DataGridView CC; CC = (System.Windows.Forms.DataGridView)sender; //Okay, Bring Up Startup Info SingleMultiLineInputForm InterfaceSingleMultiLineInputForm = new SingleMultiLineInputForm("Startup Information", "Serial Number", CC.CurrentCell.FormattedValue.ToString()); InterfaceSingleMultiLineInputForm.ShowDialog(); // InterfacesGrid.CancelEdit(); if (InterfaceSingleMultiLineInputForm.Saved) { CC.CurrentCell.Value = InterfaceSingleMultiLineInputForm.Result; SaveAndContinue.Enabled = true; SaveAndExit.Enabled = true; toolStripButton9.Text = "Cancel Changes"; } SetColumnIndex method = new SetColumnIndex(Mymethod); InterfacesGrid.BeginInvoke(method, 9); }
private void UpdateActivityLogEntry(DataGridViewCellEventArgs e) { ActivityLog activityLogToUpdate = _activityLog[e.RowIndex]; try { activityLogToUpdate.Duration = Int16.Parse(dgv_activityLog.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()); } catch { // Wrong format, no update in Database. No validation necessary for user necessary. } _context.ActivityLog.Update(activityLogToUpdate); // SetCurrentcellAddresscore error SetColumnIndex method = new SetColumnIndex(invokeMainViewUpdateActivityLog); dgv_nutritionLog.BeginInvoke(method, 1); }
public bool NextCell() { try { if ((CurrentCell != null) && (Rows[CurrentCell.RowIndex].Cells.Count > CurrentCell.ColumnIndex + 1)) { //EndEdit(); int nextindex = Math.Min(this.Columns.Count - 1, this.CurrentCell.ColumnIndex + 1); SetColumnIndex method = new SetColumnIndex(MoveMethod); this.BeginInvoke(method, nextindex); return(true); } } catch (Exception ex) { log.Error("Error", ex); } return(false); }
private void UpdateNutritionLog(DataGridViewCellEventArgs e) { NutritionLog nutritionLogToUpdate = _nutritionLog[e.RowIndex]; try { nutritionLogToUpdate.Quantity = Decimal.Parse(dgv_nutritionLog.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()); } catch { // Wrong format, no update in Database. No validation necessary for user necessary. } _context.NutritionLog.Update(nutritionLogToUpdate); // SetCurrentcellAddresscore error SetColumnIndex method = new SetColumnIndex(invokeMainViewUpdateNutritionLog); dgv_nutritionLog.BeginInvoke(method, 1); }