From 6508ff742aab68e436cf390c63d383f8bd433b58 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 6 Apr 2021 13:19:02 +0200 Subject: [PATCH] LookupControl: Fix empty popup when datasource is empty but allownewvalues is true --- Controls.LookupGrid/LookupControl3.vb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Controls.LookupGrid/LookupControl3.vb b/Controls.LookupGrid/LookupControl3.vb index edd583c4..e44244b0 100644 --- a/Controls.LookupGrid/LookupControl3.vb +++ b/Controls.LookupGrid/LookupControl3.vb @@ -163,7 +163,19 @@ Public Class RepositoryItemLookupControl3 End Select Else NullText = Values.FirstOrDefault() - 'OwnerEdit.EditValue = Values.FirstOrDefault() + End If + + If DataSource Is Nothing Then + Dim oDataTable As New DataTable() + oDataTable.Columns.Add(New DataColumn("Data", GetType(String))) + + For Each oValue In Values + Dim oRow = oDataTable.NewRow() + oRow.Item(0) = oValue + oDataTable.Rows.Add(oRow) + Next + + DataSource = oDataTable End If _SelectedValues = Values