jj: update firebird
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user