Events built-in module: unable to filter by localizable cust

Posted by Community Admin on 04-Aug-2018 11:30

Events built-in module: unable to filter by localizable custom field

All Replies

Posted by Community Admin on 04-Jul-2014 00:00

Hi All,

We’re using Sitefinity 6.1 and having an issue with localizable custom
field filter in Events built-in module. We’re using the standard Events Widget,
set Filter Expression to TileLinkUrl=”” and get the Parse Exception.

If we try to load data manually, then:

  1. The following line of code:
    EventsManager.GetManager().GetItems(typeof (Event), "TileLinkUrl != \"\"", null, 0, 0)
    Results in the following exception:
    "The operands for operator 'NotEqual' do not match the parameters of method 'op_Inequality'."
  2. The following line of code:
    EventsManager.GetManager().GetEvents().Where(i => i.GetValue<Lstring>("TileLinkUrl") != "")
    Results in the following exception:
    "The binary operator Equal is not defined for the types 'Telerik.Sitefinity.Model.Lstring' and 'System.String'."
  3. The following line of code works fine:
    EventsManager.GetManager().GetEvents().Where(i => i.GetValue<string>("TileLinkUrl") != "")
How should we set the string-based Filter Expression to make it work? 

Posted by Community Admin on 08-Jul-2014 00:00

Hi Vadim,

Thank you for contacting us.

I am afraid that the Filter expressions on Sitefinity content widgets do not work with localizable text. They are only viable for number fields as pointed in our Documentation.

If you want to extend the default events widget in order for you to apply your filter, the getValue extension method is the right way to go. You can attach to the ItemDataBound event of the RadListView of the events list widget and filter each item based on your custom field.

Regards,
Ivan D. Dimitrov
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 08-Jul-2014 00:00

Hi Ivan,

Thank you for the info - we'll work around this

This thread is closed