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

  • Home
  • SEARCH
  • 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 4532086
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T13:59:06+00:00 2026-05-21T13:59:06+00:00

I have a Silverlight 4 Business Application, I’ve installed Silverlight Toolkit April 2011 and

  • 0

I have a Silverlight 4 Business Application, I’ve installed Silverlight Toolkit April 2011 and added the reference to the project. I want to to reorder a listbox using drag and drop.

My code is the following:

<Grid x:Name="LayoutRoot">
    <toolkit:ListBoxDragDropTarget AllowDrop="True">
        <ListBox  AllowDrop="True" Name="listBox1">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Vertical"></StackPanel>

                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
        </ListBox>
    </toolkit:ListBoxDragDropTarget>
  </Grid>

And

private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            listBox1.ItemsSource = new Int32[] {1,2,3,4,5 };
        }

When trying to drag an item I see the “ghost” of the item and an icon whth two arrows (an up and a down arrow) but when I drop it (in the same listbox) nothing happens! It doesnt get reordered.

What am I doing wrong???
Do I have to listen to an event and implement something??

Thanks!

EDIT: The complete code is:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;

namespace editorencuestas
{
    public partial class testdragdrop : Page
    {
        public testdragdrop()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            listBox1.ItemsSource = new Int32[] {1,2,3,4,5 };
        }

    }
}

AND

<navigation:Page x:Class="editorencuestas.testdragdrop" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="testdragdrop Page" xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" Loaded="Page_Loaded">
    <Grid x:Name="LayoutRoot">
        <toolkit:ListBoxDragDropTarget AllowDrop="True">
            <ListBox x:Name="listBox1" Height="175" Width="147">
                <ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel />
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
            </ListBox>
        </toolkit:ListBoxDragDropTarget>
        </Grid>
</navigation:Page>
  • 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-05-21T13:59:07+00:00Added an answer on May 21, 2026 at 1:59 pm

    can you pls try this?

            <ListBox x:Name="yourListBox">
                <ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel/>
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
            </ListBox>
    

    Sorry I was wrong.

    If you do this it will work.

            var list = new ObservableCollection<int>();
    
            list.Add(1);
            list.Add(2);
            list.Add(3);
    
            listBox1.ItemsSource = list;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have silverlight business application. I added an invoke method to my AuthenticationService class
I have a Silverlight Business Application. I want to store the username and password
I have created a new silverlight business application. I have added mysql.data, mysql.web, mysql.data.entity
I have created a new silverlight business application in visual studio. It auto generates
I am currently working on a silverlight business application, so I have come across
Starting with the most simple case. If I press File->new project->silverlight business application it
I have a Silverlight RIA application that uses Forms authentication. We want to pass
I have created a Silverlight business application, that require the user to login, and
We are starting a new SilverLight 4 Business Application project and are looking for
I have reading Pro Business Application with Silverlight 4 by Chris Anderson, Regarding the

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.