if (e.Column.Name == colProduct.Name) // Gets the column { if (View.GetRowCellValue(e.RowHandle, colProduct).ToString() != "") // Double checks the cell isn't blank { string SupplierProduct = View.GetRowCellValue(e.RowHandle, colProduct).ToString(); // Get the cell if (!string.IsNullOrWhiteSpace(SupplierProduct)) { e.Appearance.BackColor = Color.Crimson; // Changes erroring cell to red e.Appearance.ForeColor = Color.White; // Changes text colour to white View.OptionsBehavior.ReadOnly = false; // If there's an error the whole GridView is editable View.OptionsBehavior.Editable = true; SupplierProductNotFound = false; // Reset to default } } }
e.Handled = true;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)