Sniipe
Sniipe

Reputation: 1296

Drag and Drop event no longer firing

I was having issues with my project with drag and drop no longer working. I created a new simple project to isolate the issue. (based on this) I simply created a listview (listView1), changed the background to blue. I then added 3 events from the TaskPaneControl designer which I then added a line of code as follows:

private void listView1_DragDrop(object sender, DragEventArgs e)
{
    string test = "";
}

private void listView1_DragEnter(object sender, DragEventArgs e)
{
    string test = "";
}

private void listView1_DragOver(object sender, DragEventArgs e)
{
    string test = "";
}

I put a breakpoint in each line and expected it to be hit. The breakpoint will hit TaskPane_VisibleChanged but for some reason it won't hit the listview1_DragXXX

Upvotes: 0

Views: 107

Answers (1)

Sniipe
Sniipe

Reputation: 1296

I made a change to the designer and in doing so I inadvertently set allowdrop on the user control be set to false. Once I set it to true it worked.

Upvotes: 1

Related Questions