4 Commits

Author SHA1 Message Date
Jonathan Jenne
858ac7d312 GlobalIndexer: Version 1.0.1 2021-04-06 14:22:31 +02:00
Jonathan Jenne
ec8c0c7cd9 GlobalIndexer: Setup oncontrolchanged handler before default value 2021-04-06 14:21:21 +02:00
Jonathan Jenne
581b8d4f1f LookupGrid: Version 3.0.2 2021-04-06 14:18:06 +02:00
Jonathan Jenne
df261a36ac LookupControl: fix values disappearing from popup on second open 2021-04-06 14:17:38 +02:00
4 changed files with 18 additions and 11 deletions

View File

@@ -49,6 +49,7 @@ Public Class RepositoryItemLookupControl3
SetDropdownButtonEnabled(_MultiSelect)
End Sub
Private Const NAME_DATATABLE_INTERNAL = "__INTERNAL_DATATABLE__"
Private Const TAG_DROPDOWN = "openDropdown"
Private Const TAG_BUTTON_LOOKUP_FORM = "openLookupForm"
@@ -165,8 +166,12 @@ Public Class RepositoryItemLookupControl3
NullText = Values.FirstOrDefault()
End If
If DataSource Is Nothing Then
Dim oDataTable As New DataTable()
' If No external Datasource is supplied, create one containing the currently selected values
' If the current datasource is the internal one, update it
If DataSource Is Nothing OrElse (TypeOf DataSource Is DataTable AndAlso DirectCast(DataSource, DataTable).TableName = NAME_DATATABLE_INTERNAL) Then
Dim oDataTable As New DataTable() With {
.TableName = NAME_DATATABLE_INTERNAL
}
oDataTable.Columns.Add(New DataColumn("Data", GetType(String)))
For Each oValue In Values
@@ -248,9 +253,9 @@ Public Class RepositoryItemLookupControl3
If DataSource IsNot Nothing AndAlso DataSource.Columns.Count > 0 Then
Dim oFirstColumn As String = DataSource.Columns.Item(0).ColumnName
Dim oWrapped = SelectedValues.Select(Function(v As String)
Return $"'{v}'"
End Function).ToArray()
Dim oWrapped = SelectedValues.
Select(Function(v As String) $"'{v}'").
ToArray()
Dim oValueString As String = String.Join(",", oWrapped)
Dim oCriterium As String = $"[{oFirstColumn}] IN ({oValueString})"
View.ActiveFilterCriteria = DevExpress.Data.Filtering.CriteriaOperator.Parse(oCriterium)

View File

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("3.0.1.0")>
<Assembly: AssemblyFileVersion("3.0.1.0")>
<Assembly: AssemblyVersion("3.0.2.0")>
<Assembly: AssemblyFileVersion("3.0.2.0")>

View File

@@ -187,6 +187,10 @@ Public Class ControlCreator
oControl.Properties.PreventDuplicates = pPreventDuplicateValues
oControl.Properties.AppearanceFocused.BackColor = HightlightColor
' Add Handler before assigning Default Value so
' OnControlChanged will fire for default values as well
AddHandler oControl.Properties.SelectedValuesChanged, Sub() OnControlChanged.Invoke(oControl)
If Not String.IsNullOrEmpty(pDefaultValue) Then
Dim oDefaultValues As New List(Of String)
@@ -204,8 +208,6 @@ Public Class ControlCreator
oControl.Properties.SelectedValues = oDefaultValues
End If
AddHandler oControl.Properties.SelectedValuesChanged, Sub() OnControlChanged.Invoke(oControl)
If OnLookupData Is Nothing Then
Logger.Warn("LookupGrid Datasource could not be set, OnLookupData Function is not defined!")
End If

View File

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' indem Sie "*" wie unten gezeigt eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>
<Assembly: AssemblyVersion("1.0.1.0")>
<Assembly: AssemblyFileVersion("1.0.1.0")>