Is there a way to use conditional formating to detect if a non number is entered into a cell?
1 Answer, 1 is accepted
0
Jack
Telerik team
answered on 04 Sep 2007, 04:25 PM
Hello Tony De Wit,
Thank you for this question.
This is a complex condition and can't be done using standard conditional formating. To have more control over formatting conditions, you should use the CellFormatting event. The following code presents a solution to your case:
this.radGridView1.CellFormatting += new CellFormattingEventHandler(radGridView1_CellFormatting);
void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement.ColumnInfo.UniqueName == "SomeColumn") { int result = 0; if (!int.TryParse((string)e.CellElement.Value, result)) e.CellElement.BackColor = Color.Red; } }