Syncfusion.Grid.Windows
Example 


Text to be validated.

ValidateString Method (GridCellRendererBase)

Called from OnValidate and checks whether the specified text is valid.
Syntax
'Declaration
 
Public Overridable Function ValidateString( _
   ByVal text As String _
) As Boolean
'Usage
 
Dim instance As GridCellRendererBase
Dim text As String
Dim value As Boolean
 
value = instance.ValidateString(text)
public virtual bool ValidateString( 
   string text
)

Parameters

text
Text to be validated.

Return Value

True if text if valid; False otherwise.
Remarks
This also works for limiting the keyboard input, e.g. only digits. Called after the user pressed a key and before it is accepted.
Example
Don't allow "-" to be typed.
public override bool ValidateString(string text)
{
     TraceUtil.TraceCurrentMethodInfoIf(Switches.CellRenderer.TraceVerbose, text);
            
     if (text.IndexOf("-") != -1)
          return false;
     return true;
}
AssemblyVersion

Syncfusion.Grid.Windows: 18.2460.0.44

See Also