Getting Event Filters in Code
If we do /yyyy/MM/dd in the URL to filter down the event widget, how do I grab the current filter in the code behind?
I really just need to know a filter exists so I can show an element (back link)
Also,
I need to show something when there are no events on that date...I tried the empty containers, but it didnt seem to do anything.
<
EmptyDataTemplate
>
No Events Today
</
EmptyDataTemplate
>
<
EmptyItemTemplate
>
No Events
</
EmptyItemTemplate
>
Hi Steve,
You need to get an instance of the control on your page. Then you can call MasterViewDefinition.FilterExpression. This will get the filter that is set as a property of the control. Another option is overriding InitializeControls method MasterView that your widget uses and there check whether the dynamic filter expression returns results.
The third option is getting the date query from the url evaluator
var query = this.Manager.GetEvents();
query = this.EvaluateUrl(query, "Date", this.Host.DateEvaluatorPropertyName, this.Host.UrlEvaluationMode, this.Host.UrlKeyPrefix);
and use
DataProviderBase.SetExpressions to see if there will be items returned by your control.
Greetings,
Ivan Dimitrov
the Telerik team