)
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

What should to when I get a "DragDrop registration failed" error as I try to run the application containing the WinForms GridControl?

Platform: WinForms |
Control: GridControl |
Published Date: April 30, 2011 |
Last Revised Date: December 20, 2019

OLE drag and drop

The most likely cause of this problem is that your Main entry point does not have the [STAThread] attribute associated with it. Without this attribute, the Essential Grid support of the OLE Drag and Drop causes this error.

Solution:

There are two possible solutions. The first one is to add the [STAThread] attribute and remove the [MTAThread] attribute in case it is present. The second one is to remove the OLE Drag and Drop support from the Essential Grid.

Solution 1: Here is a sample Main entry point with the STAThread attribute.

C#

[STAThread]
static void Main()
{
    Application.Run(new Form1());
}

VB

<STAThread>
Shared Sub Main()
 Application.Run(New Form1())
End Sub

Solution 2: To remove OLE Drag and Drop support so that your application can be MTAThread.

  • Change the Main attribute [STAThread] to [MTAThread].
  • Turn the AllowDrop off.
  • Turn off the OLE options in the ControllerOptions.
  • Set the DataObjectConsumerOptions to none.

C#

[MTAThread]
static void Main()
{
    Application.Run(new Form1());            
}
//In Form_Load.
//Turns AllowDrop off.
this.gridControl1.AllowDrop = false;
//Turns off the OLE options in ControllerOptions
this.gridControl1.ControllerOptions -= GridControllerOptions.OleDataSource | GridControllerOptions.OleDropTarget;
//Sets DataObjectConsumerOptions value as “None”. 
this.gridControl1.DataObjectConsumerOptions = GridDataObjectConsumerOptions.None; 

VB

<MTAThread>
Shared Sub Main()
 Application.Run(New Form1())
End Sub
'In Form_Load
'Turns AllowDrop off.
Me.gridControl1.AllowDrop = False
'Turns off the OLE options in ControllerOptions.
Me.gridControl1.ControllerOptions -= GridControllerOptions.OleDataSource Or GridControllerOptions.OleDropTarget
' Sets DataObjectConsumerOptions value as “None”. 
Me.gridControl1.DataObjectConsumerOptions = GridDataObjectConsumerOptions.None

 

2X faster development

The ultimate WinForms 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.

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
Live Chat Icon