Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8019787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:29:48+00:00 2026-06-04T21:29:48+00:00

Hopefully this is an easy question. I’m using the ListBoxDragDropTarget from the Silverlight Toolkit

  • 0

Hopefully this is an easy question. I’m using the ListBoxDragDropTarget from the Silverlight Toolkit to set up drag and drop from one ListBox to another. I can’t seem to get the event to fire. Here’s my XAML code:

<toolkit:ListBoxDragDropTarget HorizontalAlignment="Left"
                               HorizontalContentAlignment="Stretch"
                               VerticalAlignment="Top"
                               VerticalContentAlignment="Stretch"
                               Margin="39,117,0,0"
                               Grid.Row="1"
                               AllowDrop='True'>
  <ListBox x:Name='columnHeadings'
           MinHeight='100'
           MinWidth='100'>
  </ListBox>
</toolkit:ListBoxDragDropTarget>

<toolkit:ListBoxDragDropTarget AllowDrop='True'
                               Grid.Column='1'
                               Grid.Row='1'
                               HorizontalContentAlignment="Stretch"
                               VerticalContentAlignment="Stretch"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Left">
  <ListBox x:Name='customerFields'
           Grid.Column='1'
           Grid.Row='1'
           Visibility='Collapsed'
           Drop='CustomerFieldsDrop'>
  </ListBox>
</toolkit:ListBoxDragDropTarget>

And here’s my event handler in the code behind page:

private void CustomerFieldsDrop(object sender, DragEventArgs e)
{
  MessageBox.Show(string.Format("Something was dropped!"));
}

As you can see, I was aiming for something real simple. I tried assigning an event handler to the parent ListBoxDragDropTarget for the customerFields List Box; ironically, that worked.

My purpose here is to allow a user to import a text file and get a listing of the file’s column headers in one List Box and then “connect” them to data fields listed in the second List Box. So no list reordering or moving items from one list to another.

The columnHeadings.ItemsSource property is a string[] object. The customerFields.ItemsSource property is an IEnumerable<string> object.

Any insight would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T21:29:49+00:00Added an answer on June 4, 2026 at 9:29 pm

    I think the AllowDrop=”True” and Drop=”EventName” properties need to be within the same element to work. You probably have to set the AllowDrop property to “True” in the ListBox itself:

    <ListBox x:Name="customerFields" 
        Grid.Column="1" 
        Grid.Row="1" 
        Visibility="Collapsed"
        Drop="CustomerFieldsDrop"
        AllowDrop="True" 
    </ListBox> 
    

    Or add the Drop=”CustomerFieldsDrop” property to the ListBoxDragDropTarget tag:

    <toolkit:ListBoxDragDropTarget AllowDrop='True'   
        Grid.Column='1'   
        Grid.Row='1'   
        HorizontalContentAlignment="Stretch"   
        VerticalContentAlignment="Stretch"   
        VerticalAlignment="Center"   
        HorizontalAlignment="Left"
        Drop="CustomerFieldsDrop">
    

    Either one should work…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is (hopefully) an easy question. I have to submit a request to a
This is hopefully an easy question to answer for someone familiar with Mozilla, but
Hopefully, this is an easy one. I have an array with lines that contain
Hopefully this is an easy question. How can I define an XML type such
Hopefully this will be an easy question! I have two tables, a 'client(s)' table
I just started WPF this morning so this is (hopefully) an easy question to
Hopefully this question has an easy answer. It's probably something stupid I'm doing! In
Hopefully an easy question. From the example on http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/uiswing/components/combobox.html on Providing a Custom Renderer
Hopefully this is a quick and easy question to answer. Do I need the
Hopefully a very easy question for you. I have a PHP object, one of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.