void dataItemskryptonDataGridView_CellValidated(object sender, DataGridViewCellEventArgs e) { if (m_editMode == EditMode.View) { return; } if (!itemsDataGrid[e.ColumnIndex, e.RowIndex].IsInEditMode) { return; } if ((e.ColumnIndex == priceColumn.Index) || (e.ColumnIndex == QtyColumn.Index) || (e.ColumnIndex == discpercentColumn.Index) || (e.ColumnIndex == discAmountColumn.Index) || (e.ColumnIndex == discabcColumn.Index) ) { updateSubtotal(e.RowIndex); } if (e.ColumnIndex == unitColumn.Index) { Part p = (Part)itemsDataGrid[codeColumn.Index, e.RowIndex].Tag; object ou = itemsDataGrid[unitColumn.Index, e.RowIndex].Value; if ((p == null) || (ou == null)) { return; } Unit u = (Unit)Utils.FindEntityInList(ou.ToString(), m_units); itemsDataGrid[priceColumn.Index, e.RowIndex].Value = r_si.GetTheLatestSIPrice(((Customer)supplierkryptonComboBox.SelectedItem).ID, p.ID, u.ID); updateSubtotal(e.RowIndex); } }