Data Annotation and EF6

Refresh

April 2019

Views

56 time

1

I working on wpf application with syncfusion datagrid (SfDataGrid). The grid uses a data-annotation for autogenerated columns. The model is prepared by EF6. I'm trying to set a column header. This code works (header showing):

    public partial class ViewShortConsumer
    {           
        [Display(Name = "Header of Column"]
        public string Firm { get; set; }
    }

But this - not work (header is default):

using System.ComponentModel.DataAnnotations;
{
    [MetadataType(typeof(ViewShortConsumerMetadata))]
    public partial class ViewShortConsumer
    {             
        public string Firm { get; set; }     
    }


public class ViewShortConsumerMetadata
{
    [Display(Name = "Header of Column"]
    public string Firm;
}

What could be the problem? Thanks.

0 answers