Hi Muhammad,
Thank you for using Syncfusion products.
Your requirement of adding validation to the grid editing can be achieved. Please refer to the following steps to achieve your requirement.
Step #1: Add the following scripts for validation
<script src="<%= Url.Content("~/Scripts/MicrosoftMvcValidation.debug.js") %>" type="text/javascript"></script>
<script src="<%= Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js") %>" type="text/javascript"></script>
<script src="<%= Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%= Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>
Step #2: Set ClientValidationEnabled and UnobtrusiveJavaScriptEnabled as true in web.config.
<configuration>
….
<appSettings>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
. .
</appSettings>
</configuration>
Step #3: set validation attributes to the grid columns fields
public class EditableCompanyShare
{
[Required(ErrorMessage = "CurrentRate is required.")]
public Int32 CurrentRate
{
get;
set;
}
[Compare("CurrentRate", ErrorMessage = "Predicted Rate should be equal to Current Rate")]
public Int32 PredictedRate
{
get;
set;
}
}
For your reference , we have prepared the sample and the same can be downloaded from the following link:
http://www.syncfusion.com/downloads/Support/DirectTrac/102431/Sample2047884833.zip
Please try this and let us know if you have any queries.
Regards,
Eswari S