fix focus problem in search start

This commit is contained in:
Jonathan Jenne 2020-11-24 16:25:48 +01:00
parent 8e64ef1978
commit 0dd9788d8f
3 changed files with 31 additions and 27 deletions

View File

@ -223,15 +223,24 @@ Public Class ClassControlCreator
oMyNewGridControl.DataSource = oDTSource oMyNewGridControl.DataSource = oDTSource
oView.PopulateColumns() oView.PopulateColumns()
oView.FocusInvalidRow()
oMyNewGridControl.RefreshDataSource() 'oMyNewGridControl.RefreshDataSource()
oMyNewGridControl.ForceInitialize() 'oMyNewGridControl.ForceInitialize()
oWatch1.Stop() oWatch1.Stop()
Return oMyNewGridControl Return oMyNewGridControl
End Function End Function
Public Sub DeselectGridControl(BaseControl As Control)
Try
DirectCast(DirectCast(BaseControl, GridControl).MainView, GridView).FocusInvalidRow()
Catch ex As Exception
Logger.Error(ex)
End Try
End Sub
Public Function AddCheckBox(pIndexname As String, y As Integer, pVorbelegung As String, pCaption As String) As CheckBox Public Function AddCheckBox(pIndexname As String, y As Integer, pVorbelegung As String, pCaption As String) As CheckBox
Try Try
Dim oValue As Boolean = False Dim oValue As Boolean = False

View File

@ -196,12 +196,12 @@ Public Class frmGlobix_Index
End Sub End Sub
Private Sub SaveProfileItem_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles SaveProfileItem.CheckedChanged 'Private Sub SaveProfileItem_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles SaveProfileItem.CheckedChanged
My.UIConfig.Globix.ProfilePreselection = SaveProfileItem.Checked ' My.UIConfig.Globix.ProfilePreselection = SaveProfileItem.Checked
My.SystemConfigManager.Save() ' My.SystemConfigManager.Save()
End Sub 'End Sub
Private Sub SkipItem_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles SkipItem.ItemClick Private Sub SkipItem_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles SkipItem.ItemClick
My.Database.ExecuteNonQuery($"DELETE FROM TBGI_FILES_USER WHERE GUID = {My.Application.Globix.CURRENT_WORKFILE_GUID}") My.Database.ExecuteNonQuery($"DELETE FROM TBGI_FILES_USER WHERE GUID = {My.Application.Globix.CURRENT_WORKFILE_GUID}")
CancelAttempts = 2 CancelAttempts = 2
Close() Close()

View File

@ -225,25 +225,16 @@ Public Class frmSearchStart
Dim oMyControl As Control = Nothing Dim oMyControl As Control = Nothing
If oAttributeType = ATTR_TYPE_STRING Or oAttributeType = ATTR_TYPE_INTEGER Then If oAttributeType = ATTR_TYPE_STRING Or oAttributeType = ATTR_TYPE_INTEGER Then
oMyControl = oControls.CreateExistingGridControl(oAttributeRow, oXPosition, oYPositionControl) oMyControl = oControls.CreateExistingGridControl(oAttributeRow, oXPosition, oYPositionControl)
Dim myDGV As GridControl = CType(oMyControl, GridControl) Dim oGrid As GridControl = CType(oMyControl, GridControl)
Dim omyDTSource As DataTable = CType(myDGV.DataSource, DataTable) Dim oDataSource As DataTable = CType(oGrid.DataSource, DataTable)
If Not IsNothing(omyDTSource) Then If Not IsNothing(oDataSource) AndAlso oDataSource.Rows.Count = 1 Then
If omyDTSource.Rows.Count = 1 Then oSingleResult = True
oSingleResult = True
' AddSearchAttribute(oAttriID, oAttriTitle, omyDTSource.Rows(0).Item(oAttriTitle).ToString)
End If
End If End If
Dim oView As GridView Dim oView As GridView = CType(oGrid.MainView, GridView)
oView = CType(myDGV.MainView, GridView)
oMyLastGridView = oView oMyLastGridView = oView
If CBool(oAttributeRow.Item("MULTISELECT")) = True Then
'AddHandler oView.SelectionChanged, AddressOf RenewSearchAttributes
Else
' AddHandler oView.FocusedRowChanged, AddressOf FocusedRowChanged
End If
oView.FocusInvalidRow() oView.FocusInvalidRow()
ElseIf oAttributeType = ATTR_TYPE_DATE Then ElseIf oAttributeType = ATTR_TYPE_DATE Then
@ -264,6 +255,10 @@ Public Class frmSearchStart
If oMyControl IsNot Nothing Then If oMyControl IsNot Nothing Then
SelectedTab.Controls.Add(oMyControl) SelectedTab.Controls.Add(oMyControl)
If oAttributeType = ATTR_TYPE_STRING Or oAttributeType = ATTR_TYPE_INTEGER Then
oControls.DeselectGridControl(oMyControl)
End If
End If End If
oXPosition += oControlWidth + 20 oXPosition += oControlWidth + 20
@ -311,10 +306,10 @@ Public Class frmSearchStart
Dim octrlType = oControl.GetType.ToString Dim octrlType = oControl.GetType.ToString
Dim oAttrID As Integer Dim oAttrID As Integer
Dim oAttrTitle As String Dim oAttrTitle As String
Select Case oControl.GetType.ToString Select Case oControl.GetType.FullName
Case "DevExpress.XtraGrid.GridControl" Case GetType(GridControl).FullName
Dim oMyGridControl As GridControl = CType(oControl, GridControl) Dim oMyGridControl As GridControl = CType(oControl, GridControl)
Dim oMyGridView As DevExpress.XtraGrid.Views.Grid.GridView = CType(oMyGridControl.MainView, GridView) Dim oMyGridView As GridView = CType(oMyGridControl.MainView, GridView)
Dim oSelectedRows As Integer() = oMyGridView.GetSelectedRows() Dim oSelectedRows As Integer() = oMyGridView.GetSelectedRows()
If oSelectedRows.Count = 0 Then If oSelectedRows.Count = 0 Then
Continue For Continue For
@ -327,7 +322,7 @@ Public Class frmSearchStart
Dim oInsert = $"EXEC PRIDB_NEW_USER_SEARCH_CRITERIA {SEARCH_ID.ToString},{My.Application.User.UserId.ToString},{oAttrID.ToString},'{oResult}','{My.Application.User.UserName}'" Dim oInsert = $"EXEC PRIDB_NEW_USER_SEARCH_CRITERIA {SEARCH_ID.ToString},{My.Application.User.UserId.ToString},{oAttrID.ToString},'{oResult}','{My.Application.User.UserName}'"
My.DatabaseIDB.ExecuteNonQuery(oInsert) My.DatabaseIDB.ExecuteNonQuery(oInsert)
Next Next
Case "DevExpress.XtraEditors.DateEdit" Case GetType(DateEdit).FullName
' MsgBox("Date") ' MsgBox("Date")
Dim oDateEdit As DateEdit = CType(oControl, DateEdit) Dim oDateEdit As DateEdit = CType(oControl, DateEdit)
If ChangedDateControls Is Nothing Then If ChangedDateControls Is Nothing Then
@ -365,7 +360,7 @@ Public Class frmSearchStart
End If End If
Next Next
Case "System.Windows.Forms.CheckBox" Case GetType(CheckBox).FullName
Dim myCheckBox As CheckBox = CType(oControl, CheckBox) Dim myCheckBox As CheckBox = CType(oControl, CheckBox)
If myCheckBox.CheckState <> CheckState.Indeterminate Then If myCheckBox.CheckState <> CheckState.Indeterminate Then
oAttrID = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).AttributeID oAttrID = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).AttributeID