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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:33:18+00:00 2026-05-30T08:33:18+00:00

Wpf binding is funny for those who know it well and it is nightmare

  • 0

Wpf binding is funny for those who know it well and it is nightmare for newbie.
If I bind a combobox to the commented out CollectionView the control shows all the elements, including those excluded by the filter. If I bind the same combobox to a ICollectionView it displays only the filtered elements and it is Ok.

 //public CollectionView MyCapitoliList { get; private set; }
 public ICollectionView MyCapitoliList { get; private set; }

Here is the code I use to create the CollectionView and ICollectionView

MyCapitoliList = CollectionViewSource.GetDefaultView(listaCapitoli);
//MyCapitoliList = new CollectionView(listaCapitoli);


MyCapitoliList.Filter = new Predicate<object>(isCapitoloMaster);

I checked the CollectionView printing all its elements from C# code and it contains only the filtered elements, so the CollectionView is Ok.
Why do I get all the unfiltered elements if I bind it to a combobox ?

Thanks
Filippo

  • 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-30T08:33:19+00:00Added an answer on May 30, 2026 at 8:33 am

    MSDN says about CollectionView class…

    You should not create objects of this class in your code. To create a
    collection view for a collection that only implements IEnumerable,
    create a CollectionViewSource object, add your collection to the
    Source property, and get the collection view from the View property.

    It further adds …

    In WPF applications, all collections have an associated default
    collection view. Rather than working with the collection directly, the
    binding engine always accesses the collection through the associated
    view. To get the default view, use the
    CollectionViewSource.GetDefaultView method.

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

Sidebar

Related Questions

For those who like a good WPF binding challenge: I have a nearly functional
I know that WPF 3.5 SP1 supports a StringFormat in a binding, but can
I'm using WPF/MVVM and am having a binding issue with a ComboBox - any
I'm new to WPF and I'm trying to figure out how data binding works,
I have a strange issue when binding a combobox in a WPF window. I
I'm playing around with WPF Binding and variables. Apparently one can only bind DependencyProperties.
I'm dealing with a problem in WPF binding. I'm creating a user control which
I am binding a WPF ComboBox to a nullable property of type MyEnum? (where
What does {Binding Path=.} mean in a WPF binding? I see some people use
I have a WPF sorting/binding issue. (Disclaimer: I am very new to WPF and

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.