LookupGrid: Fix error causing multiple entries in lookup control

This commit is contained in:
Jonathan Jenne 2021-04-07 13:42:14 +02:00
parent 96f3ece84e
commit 383c1ce301
2 changed files with 18 additions and 10 deletions

View File

@ -233,6 +233,7 @@ Public Class RepositoryItemLookupControl3
If oForm.NewValues.Count > 0 AndAlso TypeOf DataSource Is DataTable Then
Dim oTable As DataTable = DirectCast(DataSource, DataTable)
If oTable.TableName <> NAME_DATATABLE_INTERNAL Then
For Each oValue In oForm.NewValues
Dim oRow = oTable.NewRow()
oRow.Item(0) = oValue
@ -240,6 +241,7 @@ Public Class RepositoryItemLookupControl3
Next
End If
End If
End If
End Using
End If
End Sub

View File

@ -9,18 +9,22 @@ Public Class frmLookup
Dim LookupControl31 As New LookupControl3 With {
.Location = New Point(10, 10),
.Size = New Drawing.Size(100, 27)
.Size = New Size(300, 27)
}
Dim LookupControl32 As New LookupControl3 With {
.Location = New Point(10, 60),
.Size = New Drawing.Size(100, 27)
.Size = New Size(300, 27)
}
Dim LookupControl33 As New LookupControl3 With {
.Location = New Point(10, 110),
.Size = New Drawing.Size(100, 27)
.Size = New Size(300, 27)
}
Dim LookupControl34 As New LookupControl3 With {
.Location = New Point(10, 160),
.Size = New Size(300, 27)
}
Controls.AddRange({LookupControl31, LookupControl32, LookupControl33})
Controls.AddRange({LookupControl31, LookupControl32, LookupControl33, LookupControl34})
LookupControl31.Properties.DataSource = oTable
@ -29,10 +33,12 @@ Public Class frmLookup
LookupControl32.Properties.ValueMember = "Col1"
LookupControl32.Properties.DataSource = oTable
LookupControl33.Properties.AllowAddNewValues = True
LookupControl33.Properties.MultiSelect = True
LookupControl33.Properties.DataSource = oTable
LookupControl34.Properties.AllowAddNewValues = True
LookupControl34.Properties.MultiSelect = True
End Sub
Private Function GetDatatable(Limit As Integer) As DataTable