Fix Spalten gruppieren

This commit is contained in:
Developer01
2026-03-30 18:18:54 +02:00
parent 0125d9b047
commit 08c6a6c125
2 changed files with 27 additions and 13 deletions

View File

@@ -33,7 +33,7 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben: ' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("3.7.4.0")> <Assembly: AssemblyVersion("3.7.5.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
<Assembly: NeutralResourcesLanguageAttribute("")> <Assembly: NeutralResourcesLanguageAttribute("")>

View File

@@ -2247,13 +2247,25 @@ Public Class frmNodeNavigation
''' keine Modifier-Tasten (Shift/Ctrl) für Mehrfach-Selektion gedrückt sind. ''' keine Modifier-Tasten (Shift/Ctrl) für Mehrfach-Selektion gedrückt sind.
''' </summary> ''' </summary>
Private Sub GridViewDoc_Search_MouseDown_DragInit(sender As Object, e As MouseEventArgs) Handles GridViewDoc_Search.MouseDown Private Sub GridViewDoc_Search_MouseDown_DragInit(sender As Object, e As MouseEventArgs) Handles GridViewDoc_Search.MouseDown
' Drag-Initialisierung NICHT bei Modifier-Tasten (Mehrfach-Selektion schützen) ' ✅ Nur bei linker Maustaste und gültiger Datenzeile
If e.Button = MouseButtons.Left AndAlso If e.Button <> MouseButtons.Left Then
ModifierKeys = Keys.None AndAlso _isDraggingDoc = False
GridViewDoc_Search.FocusedRowHandle >= 0 Then _dragStartPoint = Point.Empty
Return
End If
' ✅ HitTest: Prüfen ob der Klick auf eine Datenzeile (NICHT Spaltenkopf) erfolgte
Dim oHitInfo = GridViewDoc_Search.CalcHitInfo(e.Location)
' ✅ Nur Datenzeilen erlauben Spaltenköpfe, GroupPanel, Footer explizit ausschließen
Dim oIsDataRow = (oHitInfo.InRow OrElse oHitInfo.InRowCell)
Dim oIsColumnHeader = (oHitInfo.InColumn OrElse oHitInfo.InColumnPanel)
If oIsDataRow AndAlso Not oIsColumnHeader AndAlso GridViewDoc_Search.FocusedRowHandle >= 0 Then
_dragStartPoint = e.Location _dragStartPoint = e.Location
_isDraggingDoc = True _isDraggingDoc = True
Else Else
' ✅ Kein DocID-Drag DevExpress übernimmt (Column-Drag, Grouping, etc.)
_dragStartPoint = Point.Empty _dragStartPoint = Point.Empty
_isDraggingDoc = False _isDraggingDoc = False
End If End If
@@ -2264,22 +2276,27 @@ Public Class frmNodeNavigation
Return Return
End If End If
' ✅ Systemschwelle prüfen
Dim delta As New Size(e.Location.X - _dragStartPoint.X, e.Location.Y - _dragStartPoint.Y) Dim delta As New Size(e.Location.X - _dragStartPoint.X, e.Location.Y - _dragStartPoint.Y)
If Math.Abs(delta.Width) < SystemInformation.DragSize.Width AndAlso If Math.Abs(delta.Width) < SystemInformation.DragSize.Width AndAlso
Math.Abs(delta.Height) < SystemInformation.DragSize.Height Then Math.Abs(delta.Height) < SystemInformation.DragSize.Height Then
NNLogger.Debug("MouseMove: Drag threshold not reached yet.")
Return Return
End If End If
' ✅ Alle selektierten Zeilen lesen ' ✅ Zusätzliche Prüfung während Move: Ist der Cursor noch über einer Datenzeile?
Dim oSelectedRows = GridViewDoc_Search.GetSelectedRows().ToList() Dim oHitInfo = GridViewDoc_Search.CalcHitInfo(e.Location)
If oHitInfo.InColumn OrElse oHitInfo.InColumnPanel Then
' Benutzer hat zur Spalte gezogen → DevExpress-Drag nicht unterbrechen
_isDraggingDoc = False
Return
End If
' ✅ Sicherstellen: mind. die fokussierte Zeile ist enthalten ' ── Ab hier: DocID-Drag starten ──────────────────────────────────────
Dim oSelectedRows = GridViewDoc_Search.GetSelectedRows().ToList()
If oSelectedRows.Count = 0 AndAlso GridViewDoc_Search.FocusedRowHandle >= 0 Then If oSelectedRows.Count = 0 AndAlso GridViewDoc_Search.FocusedRowHandle >= 0 Then
oSelectedRows.Add(GridViewDoc_Search.FocusedRowHandle) oSelectedRows.Add(GridViewDoc_Search.FocusedRowHandle)
End If End If
' ✅ DocIDs aus allen selektierten Zeilen lesen und validieren
Dim oDocIds As New List(Of Long) Dim oDocIds As New List(Of Long)
For Each oRowHandle In oSelectedRows For Each oRowHandle In oSelectedRows
If oRowHandle < 0 Then Continue For If oRowHandle < 0 Then Continue For
@@ -2291,16 +2308,13 @@ Public Class frmNodeNavigation
End If End If
Next Next
' ✅ Garantie: mindestens eine gültige DocID muss vorhanden sein
If oDocIds.Count = 0 Then If oDocIds.Count = 0 Then
_isDraggingDoc = False _isDraggingDoc = False
NNLogger.Warn("DragStart abgebrochen: Keine gültigen DocIDs in den selektierten Zeilen gefunden.")
Return Return
End If End If
NNLogger.Info($"DocID-DragStart: {oDocIds.Count} DocID(s)=[{String.Join(",", oDocIds)}], EntityID={_ENTITY_ID}") NNLogger.Info($"DocID-DragStart: {oDocIds.Count} DocID(s)=[{String.Join(",", oDocIds)}], EntityID={_ENTITY_ID}")
' ✅ Kommagetrennte Liste als Drag-Payload
Dim oData As New DataObject() Dim oData As New DataObject()
oData.SetData(DRAGDROP_FORMAT_DOCID, String.Join(",", oDocIds)) oData.SetData(DRAGDROP_FORMAT_DOCID, String.Join(",", oDocIds))