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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Platform: WPF |
Control: SfDataGrid |
Published Date: July 8, 2014 |
Last Revised Date: May 14, 2015 |
.NET Framework: 4

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

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

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