Hi Mike,
CurrentCellchanging,CurrentCellValidateString,CurrentCellKeyPress are fired for each Keystroke not for cell activation. Try CurrentCellValidateString event handler it is fired for each keystroke and it is a cancelable event. Please refer the sample. The sample prevents the user from entering string. It allows only numbers throughout the column two. The line of code e.cancel=true prevents any further action and maintains the focus in the current cell itself till valid value inside the current cell .
private void gridControl1_CurrentCellValidateString(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellValidateStringEventArgs e)
{
GridCurrentCell cc = this.gridControl1.CurrentCell;
if (cc.ColIndex==2)
{
double d;
if(!double.TryParse(e.Text, System.Globalization.NumberStyles.Integer, null, out d))
{
e.Cancel = true;
MessageBox.Show("only numbers");
}
}
}
Here is a sample.
intvalidation_gc.zip
Hope this helps.Let us know if you need more assistance.
Best Regards,
Jeba.