Try to fix error with profil combobox

This commit is contained in:
Jonathan Jenne 2022-01-25 14:29:24 +01:00
parent 3bf845100e
commit 59380fa964

View File

@ -1663,12 +1663,14 @@ Public Class frmIndex
FormLoaded = True
Try
_Logger.Info("Profile Preselected enabled: {0}", CONFIG.Config.ProfilePreselection)
' Letzte Auswahl merken überschreibt die automatische selektion
If CONFIG.Config.ProfilePreselection Then
checkItemPreselection.Checked = True
If CURRENT_LASTDOKART <> "" Then
_Logger.Info("Last Saved DocType: {0}", CURRENT_LASTDOKART)
Dim oFoundDocType = ComboboxDoctype.Properties.DataSource.
Cast(Of DocType)().
@ -1676,14 +1678,19 @@ Public Class frmIndex
FirstOrDefault()
If oFoundDocType IsNot Nothing Then
_Logger.Info("Setting Last Saved DocType: {0}", CURRENT_LASTDOKART)
ComboboxDoctype.EditValue = oFoundDocType
End If
'cmbDokumentart.SelectedIndex = cmbDokumentart.FindStringExact(CURRENT_LASTDOKART)
End If
End If
If ComboboxDoctype.EditValue Is Nothing And DTTBGI_REGEX_DOCTYPE.Rows.Count > 0 Then
Dim oApplyRegex = ComboboxDoctype.EditValue Is Nothing And DTTBGI_REGEX_DOCTYPE.Rows.Count > 0
_Logger.Info("Applying Profile Selection Regex: [{0}]", oApplyRegex)
If oApplyRegex Then
For Each oRoW As DataRow In DTTBGI_REGEX_DOCTYPE.Rows
Dim oOnlyFilename = Path.GetFileName(CURRENT_WORKFILE)
If Regex.IsMatch(oOnlyFilename, oRoW.Item("Regex")) Then
@ -1698,11 +1705,14 @@ Public Class frmIndex
FirstOrDefault()
If oFoundDocType IsNot Nothing Then
_Logger.Debug("DocType found: [{0}]", oFoundDocType)
ComboboxDoctype.EditValue = oFoundDocType
Exit For
End If
End If
Next
Else
ComboboxDoctype.EditValue = Nothing
End If
Catch ex As Exception
ShowErrorMessage(ex, "Form Shown")