How to 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