+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Events built-in module: unable to filter by localizable custom field

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

3 posts, 0 answered
  1. Vadim
    Vadim avatar
    2 posts
    Registered:
    04 Jul 2014
    04 Jul 2014
    Link to this post

    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? 
  2. Ivan D. Dimitrov
    Ivan D. Dimitrov avatar
    310 posts
    Registered:
    26 Mar 2015
    08 Jul 2014
    Link to this post
    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
     
  3. Vadim
    Vadim avatar
    2 posts
    Registered:
    04 Jul 2014
    08 Jul 2014 in reply to Ivan D. Dimitrov
    Link to this post

    Hi Ivan,

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

3 posts, 0 answered