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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:37:27+00:00 2026-06-18T04:37:27+00:00

I think I know what the problem is, but I have no clue as

  • 0

I think I know what the problem is, but I have no clue as to the solution to it.

I have an observable collection which i populate in a WPF DataGrid.
I have then implemented Drag and Drop for rows in the DataGrid to child grids.
If a row is dragged to another grid I change a value in the ObservableCollection and then display
the underlying data like this:

                var q = from standard in DispatchResult
                        where DispatchResult.Route == RouteName
                        select standard;

                dgRoutedData.ItemsSource = q;

I guess that me setting the itemssource to the result of the above LINQ query breaks the whole auto notification from the observable collection, so how do I get the datagrids to show filtered views that will actually update when items have their “Route” value changed?

  • 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-18T04:37:28+00:00Added an answer on June 18, 2026 at 4:37 am

    You need to notify that the change has occurred – you can always try wrapping the result of the linq query in a new ObservableCollection

    e.g.

    var col = new ObservableCollection<DispatchResult>();
    col.AddRange(q);
    dgRoutedData.ItemsSource = col;
    

    (this has the disadvantage that you need to operate on the new observable as the previous observable wont raise item changed events for the new observable)

    Or just clearing/and re-adding to the existing collection.

    I assume though you’ve avoided this because the original collection contains items that you want to filter ‘back-in’ after you’ve removed the filter. In this case you might want to keep a private backing field to hold the actual data, and use ObservableCollection<T> as a filtered window onto that backing field.

    e.g.

    _myList = new List<MyObject>(); // Populate it etc
    SomeObservable.Clear(); 
    SomeObservable.AddRange(from item in _myList where item.ID == 1 select item);
    

    Or dont re-invent the wheel and use PagedCollectionView as someone suggested which wraps the above functionality (a private backing field with a filter predicate and other functionality baked in)

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

Sidebar

Related Questions

I actually have two questions regarding the same problem but I think it is
I know how to fix the problem, but the thing is, my .android directory
I think know how to do this in C# but I'm having syntax trouble
I think I know what a B-tree is but what is a B-tree page?
Well I think I know the answer to this, but I would appreciate anybody
I've been doing some research and I think I know the answer already, but
I think I already know the answer to this one, but i hope maybe
Edit: I solved my problem but if you have anything to add please do.
I think the problem is with jQuery, i don't know for sure. Let me
I have a small but itching problem. How do I get the correct case

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.