I'm facing this weird issue of the appoint filter not working the second time around.
My Application has calendars for different users.
When I first load the scheudle view (calendar) and try to filter it all works well. But then when I try to change the calendar for another user and then apply filter on it, nothing seems to happen.
When I debugged, I realised that the predicate does hit all the time the filter is supposed to be called. But the second time around the predicate doesn't call the filter appointment method at all. I'm puzzled as to why this happens and need you to help me.
As a background, I've bound the predicate (FilteredAppointments) to the appointment filter property in the xaml and the predicate then calls the filter appointment method (which returns a bool for each appointment). Also, all these are in separate classes, i.e. the predicate and the filterAppointments method.
Please help, need to resolve this ASAP.
My Application has calendars for different users.
When I first load the scheudle view (calendar) and try to filter it all works well. But then when I try to change the calendar for another user and then apply filter on it, nothing seems to happen.
When I debugged, I realised that the predicate does hit all the time the filter is supposed to be called. But the second time around the predicate doesn't call the filter appointment method at all. I'm puzzled as to why this happens and need you to help me.
As a background, I've bound the predicate (FilteredAppointments) to the appointment filter property in the xaml and the predicate then calls the filter appointment method (which returns a bool for each appointment). Also, all these are in separate classes, i.e. the predicate and the filterAppointments method.
Please help, need to resolve this ASAP.
6 Answers, 1 is accepted
0
Maaz
Top achievements
Rank 1
answered on 02 May 2013, 07:03 AM
Any update on this? It's kind of really urgent for me to sort this out.
0
Hi Maaz,
In this example you can find how to dynamically change the filter. The example is for the RadScheduleView control for Silverlight, but the same code works fine for WPF as well.
Hope this helps.
Kind regards,
Miroslav Nedyalkov
the Telerik team
In this example you can find how to dynamically change the filter. The example is for the RadScheduleView control for Silverlight, but the same code works fine for WPF as well.
Hope this helps.
Kind regards,
Miroslav Nedyalkov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0
Maaz
Top achievements
Rank 1
answered on 03 May 2013, 12:48 PM
I've tried exactly the same thing, it filters the first time ... but it doesn't the second time around. The predicate doesn't call the filter method at all (the second time around). What could be the reason?
And could you also help me with the filter counts?
And could you also help me with the filter counts?
0
Hi Maaz,
Most probably the source of the problem is that you are not generating a new instance of the predicate, but you always return the same method. To make sure your predicate is correctly changed you need to change its value like this:
instead of
Hope this helps.
Regards,
Miroslav Nedyalkov
the Telerik team
Most probably the source of the problem is that you are not generating a new instance of the predicate, but you always return the same method. To make sure your predicate is correctly changed you need to change its value like this:
Filter =
new
Func<IAppointment,
bool
>(a =>
this
.MyFilter(a))
Filter =
this
.MyFilter;
Hope this helps.
Regards,
Miroslav Nedyalkov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0
Maaz
Top achievements
Rank 1
answered on 06 May 2013, 12:19 PM
I tried this too, but again the same problem.
When I first filter ... everything goes fine, I can filter as many times as I want to.
But when I change the user to load another calendar, there's no filtering. The predicate is called, but the second time around the predicate fails to call it's method. I still don't know why. And now when I go back to the first user again, it still doesn't filter.
When I first filter ... everything goes fine, I can filter as many times as I want to.
But when I change the user to load another calendar, there's no filtering. The predicate is called, but the second time around the predicate fails to call it's method. I still don't know why. And now when I go back to the first user again, it still doesn't filter.
0
Hi Maaz,
I tried your scenario, but the filtering works as expected. Please take a look at the attached project and let me know if I'm missing something.
Kind regards,
Miroslav Nedyalkov
the Telerik team
I tried your scenario, but the filtering works as expected. Please take a look at the attached project and let me know if I'm missing something.
Kind regards,
Miroslav Nedyalkov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.