void ClearBindings() { _ignoreLeaveRow = true; _ignorePositionChange = true; _selectedRecord = null; BindingSourceSupplierProduct.Clear(); SetReadOnly(true); BarButtonItemDelete.Enabled = false; BarButtonItemSave.Enabled = false; BindingSource.DataSource = typeof(WAYPOINT); ClearMapData(); //Mapping _ignoreLeaveRow = false; _ignorePositionChange = false; }
private void FinalizeBindings() { BindingSource.EndEdit(); GridViewSupplierProduct.CloseEditor(); GridViewSupplierProduct.UpdateCurrentRow(); //Set the code for each mapping just in case for (int rowCtr = 0; rowCtr < GridViewSupplierProduct.DataRowCount; rowCtr++) { SupplierProduct suppProd = (SupplierProduct)GridViewSupplierProduct.GetRow(rowCtr); suppProd.Product_Type = "WAY"; suppProd.Product_Code_Internal = TextEditCode.Text ?? string.Empty; } BindingSourceSupplierProduct.EndEdit(); }