To do this, changing the model is extremely difficult (but possible), requiring an ICustomTypeDescriptor or TypeDescriptionProvider and a custom PropertyDescriptor . Honestly: not worth it.
Just add pass-thru properties:
public MyClass { public MyDataClass Data{get; set;} [DisplayName("ID")] public string DataID { get {return Data.ID;} set {Data.ID = value;} } [DisplayName("Name")] public string DataName { get {return Data.Name;} set {Data.Name = value;} } }
Marc gravell
source share