10676 : Visual feedback on drag over

Question

I like to use Drag & Drop to reorder rows in a Grid. Do you have a Example or a Idee about the best way, to give the user a visual feedback about the possible insert point while moving the mouse over the rows in Drag-Mode?

MS Excel, for example, displays a horizontal line between the possible destinations if you drag rows.

Answer

I guess the standard way is to signal feedback by using the drop icon, and maybe have it changed if the drop means different things. Like in Explorer when a plus is drawn for copy and an arrow is shown for move.

If you want to do something in the grid upon dragover, you can simply collect all the necessary info in the DragOver event (cell, gridNode or what you have) keep this info in member variables, set a flag in a member variable stating that it is DragOverFeedBack-time. Call Grid.Refresh (forcing a redraw). An implement the OnGridPaintForeground to draw “something” on the grid to let the user understand what can happen once he lets go of the mouse.

Or you can simply change the CellLayout property of the effected cells within the DragOver event, to something that sticks out.

Leave a Reply