【发布时间】:2012-09-01 15:52:27
【问题描述】:
我有一个数组 arrStudents,其中包含我学生的年龄、GPA 和姓名,如下所示:
arrStudents[0].Age = "8"
arrStudents[0].GPA = "3.5"
arrStudents[0].Name = "Bob"
我尝试将 arrStudents 绑定到 DataGridView,如下所示:
dataGridView1.DataSource = arrStudents;
但数组的内容不会显示在控件中。我错过了什么吗?
【问题讨论】:
-
与其他人写的一样,我倾向于使用
BindingList<T>,以便在DataGridView中可以看到对基础数据的更改。