We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Starting a SelectionDrag operation

Thread ID:

Created:

Updated:

Platform:

Replies:

3815 Apr 10,2003 03:25 PM Apr 11,2003 06:46 AM Windows Forms 2
loading
Tags: GridControl
Olivier Choquette
Asked On April 10, 2003 03:25 PM

I want to be able to move a column that is not currently selected : To click on a column header and be able to drag it right away instead of having to click on a column and click on it again to start a column drag operation.

Administrator [Syncfusion]
Replied On April 11, 2003 04:37 AM

One way to do this would be to derive a custom mouse controller to handle the move based on the current mouse controller that handles the default moving of the columns. But that class is internal, so you would essentially have to copy it and modify it directly in your project. If you have the source code version, then you could do this. Attached is another approach. It overrides OnMouseDown, OnMouseMove and OnMouseUp in a derived grid to affect this behaviior directly. Here is a rough (very rough) sample that does this. It uses a helper class (DragHelper) available to you from the shared library to manage drawing the visual quese as you move the column. Maybe something like this would work for you (when cleaned up). Though the sample uses a derived grid to get at the MouseDown, MouseUp and MouseMove actions, you probably can do something similar just handling those events on the grid.

Olivier Choquette
Replied On April 11, 2003 06:46 AM

I tried what your code and it works great! (give or take one or two typos ;). Is there a reason why the DragHelper class was left out of the documentation? thanks for the timely response! Olivier

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;