没有在DataGridView上添加新行

问题描述 投票:0回答:1

类似于此问题DataGridView doesn’t allow user to Delete Row,我正在使用绑定源,但是在上述问题的屏幕快照中,我看不到带有*的新行。我可以选择一行,然后按Delete键,它会删除ok,只是无法以交互方式添加新行。我做错了吗?

注意:我的列是在设计时创建的。

加载数据的代码如下:

Private bindingSource1 As New BindingSource
Private Sub LoadDeploymentNotes(ByVal items As List(Of DeploymentNote))
    DataGridView1.AutoGenerateColumns = False
    Dim column = CType(DataGridView1.Columns("ColumnChange"), DataGridViewComboBoxColumn)
    column.DataSource = [Enum].GetValues(GetType(Change))
    bindingSource1.DataSource = items
    DataGridView1.DataSource = bindingSource1
    DataGridView1.Refresh()
End Sub
winforms datagridview vb.net-2010
1个回答
0
投票

Gosh在我的DeloymentNote类中需要一个没有接收自变量的构造方法。

© www.soinside.com 2019 - 2024. All rights reserved.