It depends on what you want to do. you have 2 options. either validate the row and return a messagebox displaying an error message. or you can have that little red 'x' inside the cell
both methods would work. but require slightly different implementations. both methods require you to subscribe to the Validate row event of the gridview, not the gridcontrol.
something like this would give you a textbox;
private void gridView1_ValidateRow(object sender,
DevExpress.XtraGrid.Views.Base.ValidateRowEventArgs e)
{
e.Valid = false;
}
and something like this would give you the red 'x' in the cell;
private void gridView1_ValidateRow(object sender,
DevExpress.XtraGrid.Views.Base.ValidateRowEventArgs e) {
GridView view = sender as GridView;
GridColumn inStockCol = view.Columns["UnitsInStock"];
GridColumn onOrderCol = view.Columns["UnitsOnOrder"];
//Get the value of the first column
Int16 inSt = (Int16)view.GetRowCellValue(e.RowHandle, inStockCol);
//Get the value of the second column
Int16 onOrd = (Int16)view.GetRowCellValue(e.RowHandle, onOrderCol);
//Validity criterion
if (inSt < onOrd) {
//Set errors with specific descriptions for the columns
view.SetColumnError(inStockCol, "The value must be greater than Units On Order");
view.SetColumnError(onOrderCol, "The value must be less than Units In Stock");
}
}
the information was found here: http://documentation.devexpress.com/#windowsforms/DevExpressXtraGridViewsBaseColumnView_ValidateRowtopic
this would still require the user to exit the cell,
i found some more information here: http://www.devexpress.com/Support/Center/p/A289.aspx