how to show visual feedback(red line) at drop location in datagrid instead of mouse curser.
Thanks in Advance
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sandhiya PriyaPosted Jan 2, 2026, 11:21 AM
(WPF DataGrid):
To show visual feedback (a red line) at the drop location in a
DataGrid, you must draw an adorner during drag-over. WPF does not provide this automatically.The correct approach is to use a custom Adorner that draws a red line between rows.
How it works (concept)
Handle
DragOveron theDataGridDetect the row index under the mouse
Show a red horizontal line using an
AdornerRemove the adorner on
Drop/DragLeaveStep 1: Create a Row Drop Adorner
Step 2: Show the red line during DragOver
Step 3: Remove the visual feedback
Call
RemoveAdorner()on:DropDragLeaveStep 4: Helper to find the row
Result
Red line appears between rows
Mouse cursor stays unchanged
Clear and professional drop indication
Summary
WPF doesn’t support row drop indicators by default
Use a custom Adorner
Draw a red line above/below the row
Remove it on drop
This is the standard and best-practice solution used in WPF applications.