Can anyone please suggest how should I implement column drag and drop (with auto scroll) feature in DataGridView. I know I can use the controll’s AllowUserToDragDrop option. However, since my datagridview control has relatively large number of columns, I need an auto scroll feature which follows the current drag-drop position so that users can see the destination column(s) before dropping. I have implemented the custom drag and drop feature but still I am having problem to enable auto scroll option.
Share
I am using the following class to auto-scroll a TTreeView. The TScroller is created in the Create of the Frame on which it sits, passing in the TreeView. It is destroyed in the frame’s Destroy. In the OnDragOver of the TreeView I simply call MyDragScroller.Scroll(State);
Notes:
If you have more controls that need auto-scrolling, you would need to create a TScroller per control. In that case it would probably do the performance of your app a lot of good to use some sort of observer/observed mechanism to share a timer between all scrolling controls.