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

My application allows GroupViewItems to be dragged from the GroupView control and be dropped onto one of my custom controls. Now how do I access the GroupViewItem that is being dragged?

 

The GroupView control uses a custom format type for drag-and-drop. The format name is represented by the GroupView.GroupViewFormatName string constant. The GroupViewItem being dragged can be accessed by first verifying the format of the data object and, if True, using this format name to get hold of the underlying data.

The following sample shows a simple handler for the Control.DragEnter event:

C#

private void myControl1_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)

{

if(e.Data.GetDataPresent(Syncfusion.Windows.Forms.Tools.GroupView.GroupViewFormatName) == true)

{

Syncfusion.Windows.Forms.Tools.GroupViewItem item = e.Data.GetData( Syncfusion.Windows.Forms.Tools.GroupView.GroupViewFormatName ) as Syncfusion.Windows.Forms.Tools.GroupViewItem;

// Process Drag Enter

}

}

VB

Private Sub myControl1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs)

If e.Data.GetDataPresent(Syncfusion.Windows.Forms.Tools.GroupView.GroupViewFormatName) = True Then

Dim item As Syncfusion.Windows.Forms.Tools.GroupViewItem = CType(IIf(TypeOf e.Data.GetData(Syncfusion.Windows.Forms.Tools.GroupView.GroupViewFormatName) Is Syncfusion.Windows.Forms.Tools.GroupViewItem, e.Data.GetData(Syncfusion.Windows.Forms.Tools.GroupView.GroupViewFormatName), Nothing), Syncfusion.Windows.Forms.Tools.GroupViewItem)

' Process Drag Enter

End If

End Sub

Article ID: Published Date: Last Revised Date: Platform: Control:
1063 04/30/2011 07/10/2014 WinForms GroupView
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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