Try Now
More in this section

Forums / General Discussions / row count after filtering

row count after filtering

2 posts, 0 answered
  1. Zahid Ali
    Zahid Ali avatar
    47 posts
    16 Nov 2009
    18 Jan 2010
    Link to this post

    I have a control called: NewsView1 and I' below is what I'm using for filtering the news items.

            ContentFilterBuilder filter = new ContentFilterBuilder(NewsView1); 
            ContentManager contentManager = new ContentManager(); 
            if (category != null && category != "") 
                filter.AddFilter(new ContentFilterStatement("Category", category, ContentFilter.Condition.Equal)); 

    Can someone please advice, how to get the count of items after filter has been applied.

    thanks in advance.

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    19 Oct 2016
    18 Jan 2010
    Link to this post
    Hi Zahid Ali,

    You  have to create a custom control, not an user and inherits from NewsView. Then override CreateContentList() and call SelectContentCount() which will return the number of the items. Another option is calling GetContent right after the filtering and use Count to check the items in the list.

    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