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

Syncfusion grid supports data annotations?

Thread ID:





104464 Jul 20,2012 12:03 PM UTC Aug 23,2012 12:43 PM UTC ASP.NET MVC (Classic) 1
Tags: Grid
Mohit Jain
Asked On July 20, 2012 12:03 PM UTC


I am using Asp.Net MVC Syncfusion grid.


I have applied data annotations on my business objects that I bind with syncfusion grid.


Data annotations, that run on client side (e.g. Required field annotation), are not working for the fields in the Syncfusion grid. Is there some setting required for running data annotations? Or Syncfusion grid doesn't support data annotations and we have to use javascript validations?


Please suggest what is best approach here.


Many Thanks.

Gowri S [Syncfusion]
Replied On August 23, 2012 12:43 PM UTC

Hi Mohit,

Thanks for using Syncfusion Products.

Grid MVC will support Data annotation attributes. Please refer to the following code snippets:


public class EditableOrder


// Validation set to the orderId and customerId

[Required(ErrorMessage = "Order ID is required.")]

public int OrderID





[Required(ErrorMessage = "Customer  ID is required.")]

[StringLength(5, ErrorMessage = "Customer ID must be 5 characters.")]

public string CustomerID





.. . .


Add the following script files to your layout.cs within the head tag. Please refer to the following code snippets:

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>


       <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")" type="text/javascript"></script>

We have prepared the sample for your requirement and the same can be downloaded from the following link:


Also we would request you to check the following online sample link:


Please try this and let us know if you have any other queries.




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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