Gridview using a generic list as DataSource and Auto-generating columns

后端 未结 1 458
予麋鹿
予麋鹿 2020-12-18 20:52

I\'m looking to load a GridView with a generic list and have the columns be auto-generated. I am getting an exception that it does not have the correct properties to allow i

相关标签:
1条回答
  • 2020-12-18 21:14

    Try adjusting your student class and change your fields into properties like this:

    public class student
    {
       public string name { get; set; }
       public string address { get; set; }
    }
    
    0 讨论(0)
提交回复
热议问题