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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:19:59+00:00 2026-05-19T00:19:59+00:00

Previously to implementing filtering on the CollectionView, i used this to display the number

  • 0

Previously to implementing filtering on the CollectionView, i used this to display the number of rows within the datagrid;

<TextBlock Text="{Binding ElementName=dataGrid1, Path=ItemsSource.Count}" />

I have since implemented a filter as so;

ICollectionView cvs = CollectionViewSource.GetDefaultView(datagrid1.ItemsSource);
cvs.Filter = new Predicate<object>(FilterMethod);
...
public bool FilterMethod(object item) {
    // conditionally returns true/false
}

The TextBlock above still shows the unfiltered count, when visually the filter is removing items from view. How can I get the TextBlock above to show the row count as a result of the filter?

  • 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-19T00:20:00+00:00Added an answer on May 19, 2026 at 12:20 am

    The problem is that the filter is applied only on the collection view, and not on the item source.

    You can do one of 2 thing:

    1. bind to the collection view count (make sure its INPC).
    2. bind to the items control items.count property.

    This way the count will be same as what the user see.

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

Sidebar

Related Questions

Previously I have asked to strip text from a field and convert it to
I previously asked how to do this in Groovy. However, now I'm rewriting my
I've previously used jquery-ui tabs extension to load page fragments via ajax , and
I need to run an application in an embedded system continuously. While implementing this
Previously, I asked the question . The problem is the demands of our file
Previously, I had a class that wrapped an internal System.Collections.Generic.List<Item> (where Item is a
Previously I've asked about inserting a column into a dataset . I now have
I previously asked about what Mixins were, and have begun to get the gist
I previously asked a question regarding MX records (and appreciate the thoughtful answers I
Jeff has previously blogged about using the cache to perform "out of band" processing

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.