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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to validate Gantt field while Adding?

Platform: ASP.NET MVC |
Control: Gantt

In Gantt control, it is possible to validate the fields provided by the user while adding or editing the data using actionBegin client side event. This event will be triggered with requestType argument as save before saving the data to Gantt, so at this point we can validate the fields with required condition.

The following code example explains the above scenario,

.ClientSideEvents(cl => { 


             function load(args) {
                 var columns = this.getColumns();
                 var column1 = {
                     field: "ActualDate",
                     headerText: "Actual Date",
                     mappingName: "ActualDate",
                     editType: "datepicker",
                 column2 = {
                     field: "EstimateDate",
                     headerText: "Estimate Date",
                     mappingName: "EstimateDate",
                     editType: "datepicker",
                 columns.splice(4, 0, column1, column2)
             function actionBegin(args) {
                 if (args.requestType == "save") {
                     if (Date.parse(args.data.ActualDate) > Date.parse(args.data.EstimateDate)) {
                         args.cancel = true;
                         window.alert("Actual Date should not be greater than Estimated Date");



The above example shows on how to validate the custom columns and alert the user if condition fails and cancel the add operation.

Sample link:

The simple sample to validate the Gantt fields while adding/ editing the data is available in the following link. Sample

2X faster development

The ultimate ASP.NET MVC UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

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

Live Chat Icon For mobile