This is a migrated thread and some comments may be shown as answers.

[Solved] MVC grid not using correct DisplayAttribute property

3 Answers 128 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Cory Deppen
Top achievements
Rank 1
Cory Deppen asked on 30 Nov 2010, 09:57 PM
In using the 2010.2 930 version of the extensions for MVC, it appears the grid is using the Name property of DisplayAttributes instead of the ShortName property. According to the MSDN documentation [1], the ShortName "Gets or sets a value that is used for the grid column label." This makes it possible to allow grid column headers to have a different value than the labels in the UI.

If you can confirm, would it be possible to modify the property that is used in a future version?

[1]: http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.displayattribute(v=VS.100).aspx

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 01 Dec 2010, 08:07 AM
Hello Cory Deppen,

 I made a search for the DisplayAttribute in our code base but I couldn't find any. Could you please clarify? Where are we using the DisplayAttribute? We are currently using DisplayNameAttribute and DisplayFormatAttribute.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Cory Deppen
Top achievements
Rank 1
answered on 02 Dec 2010, 12:35 AM
I can understand why the MVC 2 assembly wouldn't include support for DisplayAttribute, but it sounds like the MVC 3 assembly you have available should support it.

"The [Display] attribute is new in DataAnnotations v4, so MVC 2 can't use it because we're compiled against DataAnnotations v3.5. Use [DisplayName] instead until MVC 3, where we will be compiled against DataAnnotations v4." [1]

Considering the additional properties like ShortName included on DisplayAttribute, would it be possible to get support for DisplayAttribute in the next release of the MVC 3 assembly? This should definitely allow grids on MVC 3 views to take greater advantage of DataAnnotations in .NET 4.

[1]: http://stackoverflow.com/questions/2517510/how-to-use-and-or-localize-displayattribute-with-asp-net-mvc2/2518386#2518386
0
AndiRudi
Top achievements
Rank 1
answered on 06 May 2012, 09:55 AM
This post can be deleted
Tags
Grid
Asked by
Cory Deppen
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Cory Deppen
Top achievements
Rank 1
AndiRudi
Top achievements
Rank 1
Share this question
or