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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DialogTemplate Edit Mode: How to set validation for a column based on another column value?

You can set the validation rules to a column by using the Validation Rules property of the column in Grid. In certain cases, to set validation to a column based on another column value that is, to set conditional validation to a column, refer to the following solution.

Solution

Consider a Grid with a checkbox column and based on the value of the checkbox, another column is to be enabled or disabled and accordingly the validation is also to be set for that column.

Example

To achieve the above requirement in Grid, refer to the following steps.

  1. Code for Template Edit form.

HTML

  1. Render the Grid control

JS

MVC

ASP.NET

  1. In the actionComplete events of the Grid, the textbox corresponding to the ShipCity label is disabled based on the value of the checkbox.

JS

  1. In the change event of the checkbox, when the checkbox state is changed, the error messages are hidden.

JS

 

Article ID: Published Date: Last Revised Date: Platform: Control:
4375 04/14/2015 08/06/2015 ASP.NET MVC Grid
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon