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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to enable drag and drop operation when ExcelLikeSelectionFrame property is false

Platform: WPF |
Control: GridControl

By default, in Grid Control drag and drop operation is enabled only when ExcelLikeSelectionFrame property is true. But the user can able to perform drag and drop operations even when ExcelLikeSelectionFrame is false by overriding GridExcelLikeDragDropMouseController.

For example: Create an ExcelDragDropController class inherited from GridExcelLikeDragDropMouseController interface and add the instance of this class into MouseControllerDispatcher of the grid.

In ExcelDragDropController class, HitTest method determines whether to perform drag and drop or not based on the mouse position. It returns 1 if the position is correct else returns 0.





CheckHitTest method is used to determine whether the mouse is pressed in the GridControl or not.



On MouseDown, invoke the method StartDragDrop of GridExcelLikeDragDropMouseController using Reflection to enable the drag and drop operation of the particular selected range. Please refer the code example for your reference



We have also prepared a sample for your reference,



2X faster development

The ultimate WPF UI toolkit to boost your development speed.
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.

Up arrow icon

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