This is a migrated thread and some comments may be shown as answers.

Filter Carousel by click event

5 Answers 54 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
Rick Mueller
Top achievements
Rank 1
Rick Mueller asked on 08 Nov 2010, 08:36 PM
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

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 09 Nov 2010, 08:21 AM
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
0
Rick Mueller
Top achievements
Rank 1
answered on 09 Nov 2010, 05:17 PM
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
0
Vlad
Telerik team
answered on 09 Nov 2010, 05:23 PM
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
0
Rick Mueller
Top achievements
Rank 1
answered on 09 Nov 2010, 05:47 PM
Vlad,

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

Regards,

Rick
0
Vlad
Telerik team
answered on 09 Nov 2010, 05:52 PM
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
Tags
Carousel
Asked by
Rick Mueller
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Rick Mueller
Top achievements
Rank 1
Share this question
or