Filter Carousel by click event

6 posts, 0 answers
  1. Rick Mueller
    Rick Mueller avatar
    103 posts
    Member since:
    Feb 2010

    Posted 08 Nov 2010 Link to this post

    Hello,

    I have a Carousel populated with Observsable collection using MVVM. I want to be able to filter the carousel with a button click event.

    Any Samples would be great

    THANKS
        Rick
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 09 Nov 2010 Link to this post

    Hello,

    Have you tried Where() extension method?

    Regards,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Rick Mueller
    Rick Mueller avatar
    103 posts
    Member since:
    Feb 2010

    Posted 09 Nov 2010 Link to this post

    ICollectionView EmployeeList = CollectionViewSource.GetDefaultView(Radc.ItemsSource);
      
    EmployeeList.Filter = new Predicate<object> (Contains);
          
            }
            private bool Contains(object o)
            {
                EmployeeList oEmployee = o as This.RadRadioButton.Tag(Value);
                if (oEmployee == null) return true;
      
                return !(Value);

    this is what i have so far,

    Regards,
    Rick
  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 09 Nov 2010 Link to this post

    Hi,

     If you call Refresh for your ICollectionView in this case you will reevaluate the filter. 

    Kind regards,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Rick Mueller
    Rick Mueller avatar
    103 posts
    Member since:
    Feb 2010

    Posted 09 Nov 2010 Link to this post

    Vlad,

    Could you put a sample together, I understand refresh, but I don't know how to put it into code

    Regards,

    Rick
  7. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 09 Nov 2010 Link to this post

    Hi,

     You just need to call Refresh method of EmployeeList in your button click event handler. 

    Greetings,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
UI for WPF is Visual Studio 2017 Ready