Fix Spalten gruppieren
This commit is contained in:
@@ -2247,13 +2247,25 @@ Public Class frmNodeNavigation
|
||||
''' keine Modifier-Tasten (Shift/Ctrl) für Mehrfach-Selektion gedrückt sind.
|
||||
''' </summary>
|
||||
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)
|
||||
If e.Button = MouseButtons.Left AndAlso
|
||||
ModifierKeys = Keys.None AndAlso
|
||||
GridViewDoc_Search.FocusedRowHandle >= 0 Then
|
||||
' ✅ Nur bei linker Maustaste und gültiger Datenzeile
|
||||
If e.Button <> MouseButtons.Left Then
|
||||
_isDraggingDoc = False
|
||||
_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
|
||||
_isDraggingDoc = True
|
||||
Else
|
||||
' ✅ Kein DocID-Drag – DevExpress übernimmt (Column-Drag, Grouping, etc.)
|
||||
_dragStartPoint = Point.Empty
|
||||
_isDraggingDoc = False
|
||||
End If
|
||||
@@ -2264,22 +2276,27 @@ Public Class frmNodeNavigation
|
||||
Return
|
||||
End If
|
||||
|
||||
' ✅ Systemschwelle prüfen
|
||||
Dim delta As New Size(e.Location.X - _dragStartPoint.X, e.Location.Y - _dragStartPoint.Y)
|
||||
If Math.Abs(delta.Width) < SystemInformation.DragSize.Width AndAlso
|
||||
Math.Abs(delta.Height) < SystemInformation.DragSize.Height Then
|
||||
NNLogger.Debug("MouseMove: Drag threshold not reached yet.")
|
||||
Return
|
||||
End If
|
||||
|
||||
' ✅ Alle selektierten Zeilen lesen
|
||||
Dim oSelectedRows = GridViewDoc_Search.GetSelectedRows().ToList()
|
||||
' ✅ Zusätzliche Prüfung während Move: Ist der Cursor noch über einer Datenzeile?
|
||||
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
|
||||
oSelectedRows.Add(GridViewDoc_Search.FocusedRowHandle)
|
||||
End If
|
||||
|
||||
' ✅ DocIDs aus allen selektierten Zeilen lesen und validieren
|
||||
Dim oDocIds As New List(Of Long)
|
||||
For Each oRowHandle In oSelectedRows
|
||||
If oRowHandle < 0 Then Continue For
|
||||
@@ -2291,16 +2308,13 @@ Public Class frmNodeNavigation
|
||||
End If
|
||||
Next
|
||||
|
||||
' ✅ Garantie: mindestens eine gültige DocID muss vorhanden sein
|
||||
If oDocIds.Count = 0 Then
|
||||
_isDraggingDoc = False
|
||||
NNLogger.Warn("DragStart abgebrochen: Keine gültigen DocIDs in den selektierten Zeilen gefunden.")
|
||||
Return
|
||||
End If
|
||||
|
||||
NNLogger.Info($"DocID-DragStart: {oDocIds.Count} DocID(s)=[{String.Join(",", oDocIds)}], EntityID={_ENTITY_ID}")
|
||||
|
||||
' ✅ Kommagetrennte Liste als Drag-Payload
|
||||
Dim oData As New DataObject()
|
||||
oData.SetData(DRAGDROP_FORMAT_DOCID, String.Join(",", oDocIds))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user