DotNet · 2022年5月26日

DataGridView的新增行不出现,表现像AllowAddNew=False

DataGridView的新增行不出现

检查属性AllowAddNew=True,表格不出现新行,无法添加新数据

原因和解决方法:

当前表格关联的是BindingSource,而导入数据时,把DataSource直接赋值给了DataGridView,

直接赋值给DataGridView,只有在VirtualMode下可以有新行出现,在绑定BindingSource模式下,是不会出现的,只能赋值BindingSource的DataSource

最新电影,电视剧,尽在午夜剧场

电影电视剧午夜不寂寞