Just wondering why I get compile time error : "Attribute 'DisplayColumn' is not valid on this declaration type. It is only valid on 'class' declarations."
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
namespace MyApplication.Models.DataAnnotations
{
[MetadataType(typeof(AppUser_DataAnnotations))]
public partial class AppUser
{
}
public class AppUser_DataAnnotations
{
[DisplayColumn("Name")]
public string FirstName { get; set; }
}
}
I'm using above to override mvccontrib rendered grid column headers. Any idea why I get compile time error? Any help would be greatly appreciated.
Thanks :)