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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:01:14+00:00 2026-05-27T23:01:14+00:00

I have a listbox in WPF databinded to a observablecollection <ListBox Margin=0,0,-12,0 ItemsSource={Binding ShopList}

  • 0

I have a listbox in WPF databinded to a observablecollection

                        <ListBox Margin="0,0,-12,0" ItemsSource="{Binding ShopList}"
                             ScrollViewer.VerticalScrollBarVisibility="Auto"
                             Grid.Row="1"
                             Grid.ColumnSpan="2" KeyDown="ListBox_KeyDown" KeyUp="ListBox_KeyUp"
                             >
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Margin="0,0,0,17" >
                                    <!--Replace rectangle with image-->
                                    <Rectangle Height="50" Width="50" Stroke="Black" StrokeThickness="6" Margin="12,0,9,0"/>

                                    <StackPanel Width="Auto">
                                        <TextBlock Text="{Binding Name}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
                                        <TextBlock Text="{Binding Quantity}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                    </StackPanel>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>

I then have a filter method I want called

private void ShopItemDay_Filter(object sender, FilterEventArgs e)
    {
        var item = e.Item as ShopItem;

        e.Accepted = item.Day == 1;
    }

But I cant find any properties on the Listbox to use a filter method like done here http://www.galasoft.ch/mydotnet/articles/article-2007081301.aspx

  • 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-27T23:01:14+00:00Added an answer on May 27, 2026 at 11:01 pm

    As you can see in the article you linked to, the filter is not a property of the Control. It is a property of the CollectionViewSource which is a kind of wrapper around the collection. This wrapper allows for sorting, grouping and filtering.

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

Sidebar

Related Questions

I have a WPF ListBox with its ItemsSource bound to an ObservableCollection navigation property
I have a WPF ListBox which contains a CheckBox as follow: <ListBox x:Name=MyListBox Grid.Row=1
I have WPF ListBox which is bound to a ObservableCollection, when the collection changes,
I have an instance of ObservableCollection bound to a WPF listbox with two separate
I have one WPF ListBox loaded using LINQ: lbxCalculosSec.ItemsSource = from p in database.CALCULOS
I have a WPF ListBox control and I'm setting its ItemsSource to a collection
I have a WPF Listbox defined in a DataTemplate that has its ItemsSource bound
In my project I have a WPF Listbox bound to an ObservableCollection. Every time
I have a ObservableCollection that's bound to a ListBox in WPF. I want the
I have a ListBox in WPF application as : <ListBox HorizontalAlignment=Left Margin=16,37,0,16 Name=lbEmpList Width=194

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.