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

Forums / General Discussions / EventView Control

EventView Control

2 posts, 0 answered
  1. Chris Wilper
    Chris Wilper avatar
    13 posts
    Registered:
    01 Sep 2009
    29 Sep 2009
    Link to this post
    How can I fitler the events shown on the page with a query string value.  I need to filter by Category and Tags.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    29 Sep 2009
    Link to this post
    Hi Chris Wilper,

    You need to create a custom control that inherits from EventsView. Then override CreateChildControls and use ContentFilterBuilder control to filter by category or tag. Below is a sample code:

       protected override void CreateChildControls() 
        { 
            base.CreateChildControls(); 
     
     
            if (this.Page != null && this.Page.Request.QueryString["Category"] != null
            { 
                ContentFilterBuilder filterBuilder = new ContentFilterBuilder(this); 
                filterBuilder.AddFilter(new ContentFilterStatement("Category", Page.Request.QueryString["Category"].ToString(), 
                                                                                     ContentFilter.Condition.In, 
                                                                                  ContentFilter.JoinType.And)); 
            } 
        } 
     

    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