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.
Unfortunately, activation email could not send to your email. Please try again.

XPTaskBar dragging

Thread ID:

Created:

Updated:

Platform:

Replies:

67748 Aug 29,2007 10:27 AM Sep 25,2007 10:18 AM Windows Forms 7
loading
Tags: Tools
Joshua Levine
Asked On August 29, 2007 10:27 AM

Hello,

I'm using an XPTaskBar control with one XPTaskBarBox created in the designer and one or more XPTaskBarBoxes dynamically created.

I'd like to enable dragging (copying) items from the dynamically created XPTaskBarBoxes to the designer created XPTaskBarBox, but prevent drag/dropping within any of the XPTaskBarBoxes (I want them to always remain in the order I specify).

I've tried:

e.Effect = DragDropEffects.None;

in the DragOver, DragDrop, and DragEnter events for the dynamically created XPTaskBarBoxes, and functionally that prevents dropping within the boxes, but the animation still makes it appear that it should work.

Is there a better way to do this? And what about having the default action be a copy rather than a move?

This is for Syncfusion 5.102.1 on .NET 2.0.

Thanks,
Josh

J.Nagarajan [Syncfusion]
Replied On September 3, 2007 08:07 PM

Hi Josh,

Thank you for your patience.

To prevent the drag and drop functionality of dynamically created XPTaskBar, you can set AllowDrop property of that XPTaskBar to false. You can set AllowDrop property to true for the XPTaskBarBox created in the designer. Please refer to the following code snippet

>>>>>>>>
//Dynamically created XPTaskBar
Syncfusion.Windows.Forms.Tools.XPTaskBar xptaskBar = new Syncfusion.Windows.Forms.Tools.XPTaskBar();


xptaskbox1 = new XPTaskBarBox();
xptaskbox1.Items.AddRange(new Syncfusion.Windows.Forms.Tools.XPTaskBarItem[] {
new Syncfusion.Windows.Forms.Tools.XPTaskBarItem("One", System.Drawing.Color.Empty, -1, null, null, true, true, "", new System.Drawing.Font("Microsoft Sans Serif", 8.25F), 0),
});
xptaskbox1.AllowDrop = false;
xptaskbox1.Location = new System.Drawing.Point(0, 0);
xptaskbox1.Size = new System.Drawing.Size(134, 31);
xptaskbox1.Text = "NewxpTaskBarBox1";
xptaskbox1.MouseDown += new MouseEventHandler(xptaskbox1_MouseDown);
xptaskBar.Location = new System.Drawing.Point(130, 130);
xptaskBar.Size = new System.Drawing.Size(120, 300);
xptaskBar.Controls.Add(xptaskbox1);

this.Controls.Add(xptaskBar);

void xptaskbox1_MouseDown(object sender, MouseEventArgs e)
{

string s = xptaskbox1.Items[0].Text;
DragDropEffects dde1 = DoDragDrop(s, DragDropEffects.All);
}

private void xPTaskBar1_DragOver(object sender, System.Windows.Forms.DragEventArgs e)
{
e.Effect = DragDropEffects.All;
}

private void xPTaskBar1_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.StringFormat))
{
string str = System.Convert.ToString(e.Data.GetData(DataFormats.StringFormat));
Point pt = xpTaskBarBox3.PointToClient(new Point(e.X, e.Y));
Syncfusion.Windows.Forms.Tools.XPTaskBarItem taskItem = xpTaskBarBox3.HitTest(pt);
taskItem.Text = str;
}
}
>>>>>>>>
I have attached the sample that demonstrates this completely. In this sample when you click XPTaskBar->AddTaskBar menuitem, you can create a new task bar. You can download the sample from the following page.

http://websamples.syncfusion.com/samples/Tools.Windows/67748/main.htm

Please refer to the sample and let me know if you have any questions

Regards,
Nagaraj


Joshua Levine
Replied On September 4, 2007 06:58 PM

Hi Neeraj,

Thanks for your reply - that helps (I wasn't quite sure what events I should be using after disabling AllowDrop).

In my code (and in the sample you provided), though, the dynamically created TaskBox no longer collapses. How can I make that continue to work?

Thanks again,
Josh

Joshua Levine
Replied On September 4, 2007 07:05 PM

Nagaraj, not Neeraj - thinking one thing, typed another...sorry!

--Josh

Joshua Levine
Replied On September 5, 2007 05:29 PM

It seems to be handling the MouseDown event that's causing the problem with the menu rolling up. It's also preventing the ItemClick event from working...

--Josh

Joshua Levine
Replied On September 11, 2007 02:29 PM

Does anyone have any ideas on how to make this work while still allowing the menus to collapse and the ItemClick event to work?

Also, it seems as if Sort() doesn't work on the XPTaskBarBox? Is that by design?

--Josh

Jeba S [Syncfusion]
Replied On September 18, 2007 09:38 AM

Hi Josh,

We could see the collapse issue in the sample. We are currently working on this and we will update you.

The question you have posted [Sort() for XPTaskBarBox] has raised some very significant issues, as this might be a Feature Request. We will get back to you within 2 business days with a complete response after due analysis of these issues.

Thank you for your patience.

Best Regards,
Jeba.

Jeba S [Syncfusion]
Replied On September 25, 2007 10:18 AM

Hi Josh,

Sorry for the inconvenience caused.

Thank you for opening a Incident 37444.

Please follow up the Incident 37444 for these queries.

Thank you for being patient.

Best Regards,
Jeba.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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.

;