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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Starting a SelectionDrag operation

Thread ID:





3815 Apr 10,2003 07:25 PM UTC Apr 11,2003 10:46 AM UTC WinForms 2
Tags: GridControl
Olivier Choquette
Asked On April 10, 2003 07:25 PM UTC

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 08:37 AM UTC

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 10:46 AM UTC

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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon