ColumnValidationParams
Defines validation rules for column editing in the Syncfusion React Grid to ensure data integrity. Specifies constraints and checks for input values during cell editing operations. Used to enforce data quality and consistency in editable grid columns.
Props
The following table outlines the props for the ColumnValidationParams:
| Name | Type | Default | Description |
|---|---|---|---|
| creditCard | boolean | false | Indicates whether the field’s value must be a valid credit card number. When true, enforces credit card format validation, rejecting invalid card numbers. Used for fields that require payment card information. |
| customValidator | (value: FormValueType) => string | null | null | Defines a custom validation function for the field’s value. Executes user-defined logic to validate input, returning an error message or null if valid. Used for bespoke validation scenarios not covered by standard rules. |
| date | boolean | false | Indicates whether the field’s value must be a valid date. When true, enforces date format validation, rejecting invalid date inputs. Used for fields that require date values, such as deadlines or birthdate. |
| digits | boolean | false | Indicates whether the field’s value must contain only digits. When true, enforces validation for numeric-only strings, rejecting non-digit characters. Used for fields like postal codes or phone numbers. |
boolean | false | Indicates whether the field’s value must be a valid email address. When true, enforces email format validation, rejecting invalid email inputs. Used for fields that require email addresses. | |
| equalTo | string | '' | Specifies the field name of another field whose value must match this field’s value. Enforces equality between two fields, such as password confirmation. Used for validation scenarios requiring matching inputs. |
| max | number | null | Specifies the maximum value for numeric inputs in the field. Enforces an upper bound for numeric data during editing. Used to restrict numeric inputs to a maximum value. |
| maxLength | number | null | Specifies the maximum length for string values in the field. Enforces an upper bound on the number of characters allowed during editing. Used to restrict string inputs to a maximum length. |
| min | number | null | Specifies the minimum value for numeric inputs in the field. Enforces a lower bound for numeric data during editing. Used to ensure numeric inputs meet minimum value requirements. |
| minLength | number | null | Specifies the minimum length for string values in the field. Enforces a lower bound on the number of characters allowed during editing. Used to ensure string inputs meet minimum length requirements. |
| number | boolean | false | Indicates whether the field’s value must be a valid number. When true, enforces numeric validation, rejecting non-numeric inputs. Used for fields that require numeric data, such as quantities or prices. |
| regex | RegExp | string | null | Specifies a regular expression pattern for custom validation of the field’s value. Enforces pattern matching for string inputs, such as specific formats or character sets. Used to implement complex validation rules via regex. |
| required | boolean | false | Indicates whether the field is mandatory during editing. When true, requires a non-empty value to pass validation. when false, allows empty inputs. Ensures critical fields contain valid data before submission. |
| tel | boolean | false | Indicates whether the field’s value must be a valid telephone number. When true, enforces phone number format validation, rejecting invalid phone inputs. Used for fields that require contact numbers. |
| url | boolean | false | Indicates whether the field’s value must be a valid URL. When true, enforces URL format validation, rejecting invalid URL inputs. Used for fields that require web addresses or links. |