This sample illustrates to show the error icon and set custom error.
Features
ShowHeaderErroricon is used to show error icon on RowHeader.
this.gridControl1.ShowRowHeaderErroricon = true;
ShowErroricon is used to show error icon in CurrentCell.
this.gridControl1.CurrentCell.ShowErroricon = true;
ShowErrorMessageBox is used to show the error Messagebox.
this.gridControl1.CurrentCell.ShowErrorMessageBox = true;
ValidationErrorText this text will display in the error MessageBox.
this.gridControl1.CurrentCell.ValidationErrorText = "Please enter valid text"
SetError method is used to set custom error by using CurrentCellValidating event.
void gridControl1_CurrentCellValidating(object sender, CancelEventArgs e) { long output; if (chkSetError.Checked) { long.TryParse(this.gridControl1.CurrentCell.Renderer.ControlText, out output); if (this.gridControl1.CurrentCell.ColIndex == 1 && output > 5) { if (string.IsNullOrEmpty(textBox2.Text)) this.gridControl1.CurrentCell.SetError("Please enter valid number"); else this.gridControl1.CurrentCell.SetError(textBox2.Text); } } }