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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:18:59+00:00 2026-05-23T09:18:59+00:00

I have a silverlight app using RIA DataDomainService. Silverlight app has one page with

  • 0

I have a silverlight app using RIA DataDomainService.

Silverlight app has one page with DataGrid.

I’ve set the ItemSource property of the DataGrid to the list in the Loaded event e.g.

//gets the list
List<Data> data = GetTheList();//returns the list of data
dataGrid.ItemSource = data;

This works the first time. The second time, I use the same above lines but I insert a new Data object in the list and then bind the list to the dataGrid using
dataGrid.ItemSource = data but it does not update the grid.
Grid remains the same.

On the xaml side, in the DataGrid tag:

ItemSouce = {Binding data, Mode=TwoWay}

Is this binding correct? Why does it bind the first time and not the second time with the new list?

  • 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-23T09:19:00+00:00Added an answer on May 23, 2026 at 9:19 am

    First off, setting the ItemSource in both XAML and code is redundant — the code behind will overwrite your XAML Binding setting.

    Try using an ObservableCollection instead of a List – it automatically notifies the View when items are added or removed. Then you shouldn’t have to set data.ItemSource more than once.

    ObservableCollection<Data> data = GetTheList();
    dataGrid.ItemSource = data;
    

    When you add or remove items from the ObservableCollection, the grid should automatically change. You’ll have to make sure GetTheList() returns an ObservableCollection, and use that to store your ‘Data’ objects.

    * edit – if using ObservableCollection doesn’t fit well with existing code, try setting ItemsSource to null before updating it. ex:

    private void updateMyDataGrid()
    {
        List<Data> data = GetTheList();
        dataGrid.ItemSource = null;
        dataGrid.ItemSource = data;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Silverlight 3 app using WCF RIA Services and Entity Framework for
I'm writing a Silverlight app using the MVVM pattern. I have a main view
I am developing a Silverlight app using VS2008 Express. I have just implemented a
I have a Silverlight app with a DataGrid containing some custom columns and all
I have a Silverlight app that has to load an image dynamically, depending on
I have a simple Silverlight app which simply sets a DataGrid's ItemsSource to the
I have a Silverlight 4 app which pulls entities down from a database using
I have a silverlight app using Prism practices; the current code does a search
I have a computationally intensive task that users can perform using a Silverlight app.
I have a Silverlight app that is using the MVVM pattern. I have a

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.