GridCell.CreateValidation

GridCell.CreateValidation method

Creates a validation object for a cell.

public GridValidation CreateValidation(GridValidationType validationType, bool isRequried)
ParameterTypeDescription
validationTypeGridValidationTypeValidation type.
isRequriedBooleanWhether the cell value is required.

Examples

[C#]
GridWeb GridWeb1 = new GridWeb();
GridWorksheet sheet = GridWeb1.ActiveSheet;
GridValidation v = sheet.Cells["A1"].CreateValidation(GridValidationType.CustomExpression, true);
	// Sets to number validation expression.
	v.RegEx = "\\d+";
	
[Visual Basic]
im GridWeb1 As GridWeb =  New GridWeb() 
im sheet As GridWorksheet =  GridWeb1.ActiveSheet 
	Dim v As GridValidation =  sheet.Cells["A1"].CreateValidation(GridValidationType.CustomExpression,True) 
	 ' Sets to number validation expression.
	v.RegEx = "\\d+"

See Also