VB datagrid +数组与自定义类 [英] VB datagrid + array with custom class
问题描述
我创建了一个类学生,并创建了一个包含学生的数组。
我不仅希望在datagridview中显示数组,而且如果用户对datagridview中的一个学生进行了更改,那么还应该更新数组。
我成功地在dgv中显示数组:一种方式是使用datasource prop,另一种是以图形方式进行。但是,我不知道如何让用户通过编辑dgv来编辑数组。
任何人都知道如何做到这一点?
如果网格不是只读的,并且数据源自数据源属性,则显示的任何值都应该是可编辑的,如果您双击它
I have created a class "student" and made an array which contains students. I would not only like to display the array in a datagridview, but the array should also be updated if the user makes changes to one of the students in the datagridview.
I succeeded in showing the array in the dgv: one way is using datasource prop, the other is doing is diagrammatically. However, i can't find out how to let the user edit the array by editing the dgv.
Anybody know how to do this?
If the grid is not read only,and the data is bound from the datasource property,any value displayed should be editable if you double click it
这篇关于VB datagrid +数组与自定义类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!