private void fuelTypeMetroGrid_RowLeave(object sender, DataGridViewCellEventArgs e) { if (fuelTypeBindingSource == null) { return; } if (fuelTypeMetroGrid.Rows.Count <= 1) { return; } if (!fuelTypeMetroGrid.IsCurrentRowDirty) { return; } Validate(); fuelTypeBindingSource.EndEdit(); var iResult = FuelTypeManger.Save((FuelType)fuelTypeBindingSource.Current); //toolStripStatusLabel1.Text = iResult > 0 ? @"Category saved successfully." : @"Error occurred when saving Unit."; if (iResult > 0) { InitRecords(); } }
private void InitRecords() { Cursor.Current = Cursors.WaitCursor; fuelTypeBindingSource.DataSource = FuelTypeManger.GetAll(); Cursor.Current = Cursors.WaitCursor; }