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.

How to disable drag and drop between FrozenColumns and non-frozen columns

SfDataGrid allows you to disable drag and drop option between FrozenColumns and non-Frozen columns by handling QueryColumnDragging event. QueryColumnDragging event occurs multiple times when you drag and also drop the column. You can use Reason property in QueryColumnDraggingEventArgs to identify the reason for the occurrence whether the event is fired while start dragging or dragging or dropping.

 

The QueryColumnDraggingEventArgs object has following properties:

  • Cancel: You can cancel the dragging / dropping action by setting this property to false.
  • PopupPosition: You can get position of point where you drag or drop.
  • From: It denotes column index of the column dragged / that is to be dragged.
  • To: It denotes the column index where mouse is placed over.
  • Reason: The property of enum type QueryColumnDraggingReason with DragStarting, DragStarted, Dragging, Dropping and Dropped enum values that denotes the action.

 

Based on the Reason property in QueryColumnDraggingEventArgs, you can handle the drag and drop option. Here when the Reason is QueryColumnDraggingReas on.Dropping and if the column is dragged from frozen region to non-Frozen region or non-frozen region to frozen region, then you can cancel the dropping action by setting e.Cancel to true.

C#

 

You can refer to the following sample links to disable the drag and drop between frozen column and non-frozen column for WPF platforms.

WPF: DragAndDropbetweenFrozenColumn.zip

Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework:
2378 07/08/2014 05/14/2015 WPF SfDataGrid 4
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.