Syncfusion.Grid.Windows
Example 


Syncfusion.Windows.Forms.Grid Namespace > GridControlBase Class : OnCurrentCellValidateString Method
The event data with text to be validated.

OnCurrentCellValidateString Method (GridControlBase)

Called from OnValidate and checks whether the specified text is valid and raises the CurrentCellValidateString event.
Syntax
'Declaration
 
Public Overridable Sub OnCurrentCellValidateString( _
   ByVal e As GridCurrentCellValidateStringEventArgs _
) 
'Usage
 
Dim instance As GridControlBase
Dim e As GridCurrentCellValidateStringEventArgs
 
instance.OnCurrentCellValidateString(e)
public virtual void OnCurrentCellValidateString( 
   GridCurrentCellValidateStringEventArgs e
)

Parameters

e
The event data with text to be validated.
Remarks
True if text if valid; False otherwise. This also works for limiting the keyboard input, e.g. only digits. Called after the user presses a key and before it is accepted.
Example
Don't allow "-" to be typed.
public override void OnCurrentCellValidateString(GridCurrentCellValidateStringEventArgs e)
{
    TraceUtil.TraceCurrentMethodInfoIf(Switches.CellRenderer.TraceVerbose, e);
            
    if (e.Text.IndexOf("-") != -1)
        e.Cancel = true;
            
    base.OnCurrentCellValidateString(e);
}
AssemblyVersion

Syncfusion.Grid.Windows: 17.3460.0.14

See Also