We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Adding validation to column with dropdownlist

I have an ejs-grid with a booleanedit type column and a dropdownedit type column. How can I make the dropdown selection required only when the booleanedit column is checked?

3 Replies 1 reply marked as answer

JC Joseph Christ Nithin Issack Syncfusion Team March 20, 2023 12:08 PM UTC

Hi Jazzy,

  Greetings from Syncfusion support.

  Based on your query, you want to validate a column in the grid based on another column value. Your requirement can be achieved using the custom validation. We have already discussed the same in detail in the below documentation. Please refer the below documentation for more details.

Documentation: https://helpej2.syncfusion.com/angular/documentation/grid/editing/validation#custom-validation-based-on-dropdown-change


Joseph I.

JM Jazzy Marie March 21, 2023 08:00 PM UTC

I came across this explenation, but I couldt follow it. In particular the customFn method with the switchcase. Could you tell me what part of that code I need to adjust to make a booleantype column enable/disable the validation for another column. 

DM Dineshnarasimman Muthu Syncfusion Team March 23, 2023 06:05 PM UTC

Hi Jazzy,

Query: Adding validation to column with dropdownlist

We have analyzed your query about the adding validation to column with dropdownlist in the documentation. The window['role'] stores the value of the one column and using switch case we validate the values of other column. This validation method is added to the column through column.validationRules. We have attached the documentation link for your reference.

Documentation: https://helpej2.syncfusion.com/angular/documentation/grid/editing/validation?cs-save-lang=1&cs-lang=ts#custom-validation-based-on-dropdown-change



Marked as answer
Live Chat Icon For mobile
Up arrow icon