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 3627936
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:57:07+00:00 2026-05-18T23:57:07+00:00

I am using RIA services to serve entities to a MVVM-Light enabled Silverlight application.

  • 0

I am using RIA services to serve entities to a MVVM-Light enabled Silverlight application.

I have a ViewModel which present a CollectionViewSource of entities to a listbox on the View. The reason I use a CollectionViewSource is so I can control the selected item in the ViewModel; when a new item is created I can create it and then select it for further editing (selecting an item in the listbox enables the editing of that item in a data form).

I need to enable dragdropping for the listbox to allow reordering of the items. I have looked at using the Silverlight Toolkit’s ListBoxDragDropTarget to enable this functionality but it doesn’t work – I assume this is because I need to set the listbox ItemsSource to an ObservableCollection.

If I change the CollectionViewSource in the ViewModel to an ObservableCollection how can I programmatically change the Selected Item of the listbox from the ViewModel?

Any ideas?

  • 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-18T23:57:07+00:00Added an answer on May 18, 2026 at 11:57 pm

    You can wrap your ObservableCollection<T> within the CollectionViewSource…as seen here…so that it is the backing collection of data used by the CollectionViewSource gaining the INotifyCollectionChanged behavior without losing the benefits from the CollectionViewSource; which you need for selecting an item.

        <UserControl.Resources>
           <local:DataSource x:Key="dataSource" />
              <CollectionViewSource x:Name="cvs" 
                        Source="{Binding Names, Source={StaticResource dataSource}}">
              </CollectionViewSource>
        </UserControl.Resources>
    
        ...
    
        <ListBox ItemsSource="{Binding Source={StaticResource cvs}}" 
                   Margin="5,5,5,1" Grid.ColumnSpan="4" />
    

    An end to end example from Tim Heuer can be found here which should also help you out in achieving the complete solution.

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

Sidebar

Related Questions

I am developing a silverlight 3 application using WCF RIA services. I am using
I am creating a new Silverlight 4 business application using RIA services. This will
I'm using .NET RIA Services July Preview to communicate between my Silverlight client and
Hi Im using silverlight ria services and trying to called a domain service method
I am working with WCF RIA services and have come across a sample using
I am using Unity 2.0 with Silverlight 4 and RIA Services. Is xml configuration
I am using SL 4, WCF RIA Services against Entity Framework 4.0. I have
I'm building a site using WCF RIA services and Silverlight 4. My user database,
I am really stuck trying to implement RIA Services with MVVM and a crud
I am having difficulty deploying RIA services/Silverlight 3 to a staging environment. Here is

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.