WPF Binding Problem

后端 未结 3 1049
陌清茗
陌清茗 2020-12-19 22:26

I have this object:

    class a 
    { 
        public string Application; 
        public DateTime From, To;
    }

And I declare this list

相关标签:
3条回答
  • 2020-12-19 22:52

    Check this article - http://www.codeproject.com/KB/miscctrl/GridView_WPF.aspx I think you are missing the ItemsSource= directive.

    0 讨论(0)
  • 2020-12-19 23:03

    Looks like WPF can't bind to fields directly, you have to use properties like so:

    class a
    {
        public string Application { get; set; }
        public DateTime From { get; set; }
        public DateTime To { get; set; }
    }
    
    0 讨论(0)
  • 2020-12-19 23:03

    Ok you use fields but you need properties

    class a 
    { 
        public string Application
        {
           get;set;
        }
        public DateTime From
        {
           get;set;
        } 
        public DateTime To
        {
           get;set;
        } 
    
    }
    
    0 讨论(0)
提交回复
热议问题