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

GroupView ItemDrag event

Hi, In the common treeview, you have the ItemDrag event that lets you drag an item and then drop it somewhere. I see there isn't an ItemDrag event in the GroupView. How can I drag a GroupViewItem? Do I have to detect it myself using mousemove and mousedown? Thanks, Sebastien

5 Replies

PS Prakash S Syncfusion Team June 12, 2002 06:27 PM UTC

Sebastien, The GroupView control has a built-in drag & drop implementation and this is, by default, turned on in the RC1 release of Essential Tools. So, unless the Control.AllowDrop property has been set to FALSE, the control will allow GroupViewItems to be dragged and dropped within and between controls. For drag and drop to work accurately, the GroupView.ItemSpacing value should be sufficiently large(>= 2) to allow the insert arrows to be drawn. Please note that in Essential Tools RC2 a new GroupView.AllowDragDrop property has been provided and this is set to FALSE by default. Thanks, Prakash

SL Sebastien Lange June 13, 2002 12:01 PM UTC

Prakash, How can I get the RC2? I do not see where to download it. Thanks, Sebastien

PS Prakash S Syncfusion Team June 13, 2002 01:37 PM UTC

Sebastien, We are currently wrapping up on testing with the RC2. This should be available within a few hours. All our customers will be notified when the download is ready. Regards, Prakash

SL Sebastien Lange June 18, 2002 08:00 AM UTC

Prakash, I'm using RC2 now. I set GroupView.AllowDragDrop to true. In the DragEnter event I'm looking wheither it is a GroupViewItem dragged: if (e.Data.GetDataPresent("Syncfusion.Windows.Forms.Tools.GroupViewItem",false)) e.Effect = DragDropEffects.Copy; But the format of the data dragged is: GroupViewFormatName. What can I do with this format? I do not see a GroupViewFormatName class. Remark: the control where I drop items is not a Syncfusion one. Sebastien

PS Prakash S Syncfusion Team June 18, 2002 08:50 PM UTC

Sebastien, The GroupView control uses a custom format type for drag & drop. The format name is represented by the GroupView.GroupViewFormatName string constant. The correct way to access the GroupViewItem being dragged is to first verify the format and then use this format name to get the data. Unfortunately, exposing this format type was not part of the original design and hence the GroupView.GroupViewFormatName member is protected in scope. I have made the required corrections and GroupView.GroupViewFormatName will be accessible and also documented in the future. We are currently in the process of putting together a revision for the RC2 and this update will include the above mentioned change. The should be available within the next couple of days and you will be notified. The following approach may be used once you have the update, 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 } } Thanks, Prakash

Live Chat Icon For mobile
Up arrow icon