jj: update firebird

This commit is contained in:
Jonathan Jenne
2018-12-20 15:41:40 +01:00
parent 4828fe1f55
commit f3b5c28cb2
4 changed files with 51 additions and 11 deletions

View File

@@ -10,6 +10,7 @@ Public Class LookupControl
Public Property AllowAddNewValues As Boolean
<Category("Einstellungen"), Description("Gibt an, ob das Hinzufügen von identischen Werten erlaubt ist"), DefaultValue(False)>
Public Property PreventDuplicates As Boolean
<Browsable(False)>
Public Property DataSource As DataTable
<Browsable(False)>
@@ -36,8 +37,6 @@ Public Class LookupControl
Return oForm
End Function
Private Sub Grid_Load(sender As Object, e As EventArgs) Handles Me.Load
If MultiSelect = False Then
_lookupControlSingle = New ButtonEdit With {
@@ -69,6 +68,17 @@ Public Class LookupControl
Controls.Add(_lookupControlMulti)
End If
UpdateSelectedValues(SelectedValues)
End Sub
Private Sub UpdateSelectedValues(Values As List(Of String))
If MultiSelect = True Then
_lookupControlMulti.Properties.DataSource = Values
_lookupControlMulti.Properties.NullText = IIf(Values.Count = 0, TEXT_NO_RECORDS, String.Format(TEXT_N_RECORDS, Values.Count))
Else
_lookupControlSingle.Text = Values.FirstOrDefault()
End If
End Sub
Private Sub lookupControlMulti_EditValueChanging(sender As Object, e As ChangingEventArgs)
@@ -85,8 +95,8 @@ Public Class LookupControl
If oResult = Windows.Forms.DialogResult.OK Then
Dim oValues = oForm.SelectedValues
_lookupControlMulti.Properties.DataSource = oValues
_lookupControlMulti.Properties.NullText = IIf(oValues.Count = 0, TEXT_NO_RECORDS, String.Format(TEXT_N_RECORDS, oValues.Count))
UpdateSelectedValues(oValues)
SelectedValues = oValues
End If
@@ -100,7 +110,8 @@ Public Class LookupControl
If oResult = Windows.Forms.DialogResult.OK Then
Dim oValues = oForm.SelectedValues
_lookupControlSingle.Text = oValues.FirstOrDefault()
UpdateSelectedValues(oValues)
SelectedValues = oValues
End If