More in this section

Forums / Developing with Sitefinity / Events API filters

Events API filters

2 posts, 1 answered
  1. karnan sekar
    karnan sekar avatar
    80 posts
    Registered:
    07 Jul 2009
    04 May 2010
    Link to this post
    Hi
    How to filter an event based on the culture. Presently we are filtering as below
               
    EventsManager eventsManager = new EventsManager("Events");                       Telerik.Cms.Engine.IMetaSearchInfo[] filters = new Telerik.Cms.Engine.IMetaSearchInfo[2];   filters[0] = new MetaSearchInfo(MetaValueTypes.DateTime, "Expiration_Date", DateTime.Now, SearchCondition.GreaterOrEqual);           
    filters[1] = new MetaSearchInfo(MetaValueTypes.DateTime, "Publication_Date", DateTime.Now, SearchCondition.LessOrEqual);           
    IList listOfAllContent = eventsManager.Content.GetContent(0, 1, "Event_Start ASC", filters)

    We need to add filters for culture like (Arabic, Russian, etc.).
     Please suggest us how to implement.

    Thanks,
    Karnan
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    04 May 2010
    Link to this post
    Hi karnan sekar,

    Set CurrentUICulture to a given culture. Get the items using ContentManager/EventsManager. Then, if there are any results you can filter them

    CultureInfo culture;
    culture = CultureInfo.GetCultureInfo("ar");
    System.Threading.Thread.CurrentThread.CurrentUICulture = culture;
    var manager = new EventsManager("Events");


    Sincerely yours,
    Ivan Dimitrov
    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.
    Answered
2 posts, 1 answered