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

Forums / General Discussions / Extend EventsView Control with Filtering

Extend EventsView Control with Filtering

2 posts, 0 answered
  1. Chris Wilper
    Chris Wilper avatar
    13 posts
    Registered:
    01 Sep 2009
    06 Oct 2009
    Link to this post
    I have created a new user control that inherits from EventsView.  I need to filter events on Category and Tag.  The following code is working but I can't get the syntax correct for adding an additional filter for Tag.

    protected

     

    override void CreateChildControls()

     

    {

     

    string filter = "Franchise Events";

     

     

     

    if (this.Page != null && this.Page.Request.QueryString["location"] != null)

     

    {

     

    var filterBuilder = new ContentFilterBuilder(this);

     

    filterBuilder.AddFilter(

    new ContentFilterStatement("Category", filter,

     

     

    ContentFilter.Condition.Equal,

     

     

    ContentFilter.JoinType.And));

     

     

    //filterBuilder.AddFilter(new ContentFilterStatement("Tag.Name", Page.Request.QueryString["location"].ToString(),

     

     

    // ContentFilter.Condition.In,

     

     

    // ContentFilter.JoinType.And));

     

    }

     

    base.CreateChildControls();

     

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Oct 2009
    Link to this post
    Hi Chris Wilper,

    Below is a sample of the syntax that you can use

    filterBuilder.AddFilter(new ContentFilterStatement("Tag.Name", tag.TagName, ContentFilter.Condition.Equal, ContentFilter.JoinType.And)); 

    tag.TagName is the name of ITag object. I hope this helps.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered