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

Retrieve Header Text from Data Annotations on Model

Thread ID:

Created:

Updated:

Platform:

Replies:

108690 May 7,2013 03:50 PM UTC May 14,2013 10:48 AM UTC ASP.NET MVC (Classic) 1
loading
Tags: Grid
Mike McCaughan
Asked On May 7, 2013 03:50 PM UTC

One thing that's nice about the built-in HTML Helpers like LabelFor() is that it pulls its text from the Display() Data Annotation attribute if supplied. I had assumed that the Grid would do that for the HeaderText, but I'm not seeing that happening. Is there an easy way of making that happen, or shall I create a Feature Request for it?

Rakesh D [Syncfusion]
Replied On May 14, 2013 10:48 AM UTC

 

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

 



GridSample Header Text_3c3d2610.zip

CONFIRMATION

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.

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

;