Hi Maverick,
Thank you for your interest in Syncfusion Products.
The XPMenus.Bar does not have an AllowDrop property. You could achieve this drag-drop feature by getting hold of the BarControlInternal object and handling its DragEnter and DragDrop events as shown in code below :
[C#]
CommandBarExt cmdbarext = this.mainFrameBarManager1.GetBarControl(this.bar1) as CommandBarExt;
BarControlInternal bcint = cmdbarext.BarControl as BarControlInternal;
bcint.AllowDrop = true;
bcint.DragEnter += new DragEventHandler (CommandBarExt_DragEnter);
bcint.DragDrop += new DragEventHandler (CommandBarExt_DragDrop);
private void CommandBarExt_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)
{
Console.WriteLine ("Bar Drag Enter");
if (e.Data.GetDataPresent(typeof(TreeNodeAdv)))
e.Effect = DragDropEffects.Copy;
else
e.Effect = DragDropEffects.None;
}
private void CommandBarExt_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
{
Console.WriteLine ("Bar Drag Drop");
if (e.Data.GetDataPresent(typeof(TreeNodeAdv)))
{
TreeNodeAdv node = e.Data.GetData(typeof(TreeNodeAdv)) as TreeNodeAdv;
BarItem bitem = new BarItem(node.Text);
this.mainFrameBarManager1.Items.Add(bitem);
this.bar1.Items.Add(bitem);
}
}
Please refer to the related KB article below :
How do I perform the drag drop operation between an XPToolBar and TreeViewAdv?
http://www.syncfusion.com/support/kb/tools/Default.aspx?ToDo=view&questId=247Please refer to the simple sample for your reference and let me know if this helps you.
http://websamples.syncfusion.com/samples/Tools.Windows/F76374/main.htmPlease let me know if you need further assistance.
Regards,
Hema