BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi Mike,
Thank you for using Syncfusion products.
Query : Retrieve Header Text from Data Annotations on Model ?
We would like to let you know that you can display the HeaderText for a column in Grid by defining the Display() Data Annotation attribute in model. Please refer below code snippet for further details.
[Display(Name = "Duration in Hrs")]
public int Duration { get; set; }
For your convenience we have prepared a sample for the above scenario and it is attached below. Please refer to it.
Could you please let us know whether this is the requirement you wanted to achieve using Display of Data Annotation ? If not could you please provide us more information on your requirement so that we could sort out the issue and provide you the solution for it. The information provided would be of great help in resolving your issue.
Please let us know if you have any concerns.
Regards,
Rakesh D
[EditableOrder.cs]
public class EditableOrder
{
// Validation set to the orderId and customerId
[Required(ErrorMessage = "Order ID is required.")]
public int OrderID
{
get;
set;
}
[Required(ErrorMessage = "Customer ID is required.")]
[StringLength(5, ErrorMessage = "Customer ID must be 5 characters.")]
public string CustomerID
{
get;
set;
}
.. . .
}
|
<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>
|