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

Forums / Developing with Sitefinity / NewsView Control- Filter Expression

NewsView Control- Filter Expression

6 posts, 0 answered
  1. Richa
    Richa avatar
    69 posts
    Registered:
    04 Jun 2009
    08 Sep 2009
    Link to this post

    I am having trouble with the like condition. If I use 'Title LIKE "B%"', the result comes out to be a title that has B anywhere in the Title, not the titles which start with B.
    I need to display all of the news items that start with a particular alphabet, say B. Is there a way to do this?

  2. Joe
    Joe avatar
    138 posts
    Registered:
    24 Sep 2012
    09 Sep 2009
    Link to this post
    Hi Richa,

    Thanks for contacting us.

    Using the query below, I only received news articles starting with N:

    Publication_Date <= "#now" AND Expiration_Date > "#now" AND Title like "N%"

    Can you confirm that your code looks like this?

    Regards,
    Joe
    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.
  3. Richa
    Richa avatar
    69 posts
    Registered:
    04 Jun 2009
    09 Sep 2009
    Link to this post
    My Filter Expression looks like:
    Publication_Date <= "#now" AND Expiration_Date > "#now" AND Category IN ("Members") AND Title like "J%"
    and I get folleoing results:
    Augustin J Morley Cabinetmakers, LLC
    B.R. Johnson Inc.
    Edward Joy Electric, LLC
    J & B Builders, Inc.
    Willowbrook Construction by John Rao
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    11 Sep 2009
    Link to this post
    Hello Richa,

    We are not able to reproduce this problem locally. Please take a look at the attached video. We used the same titles as yours. Only the first letter of the Title string is taken.

    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.
  5. Richa
    Richa avatar
    69 posts
    Registered:
    04 Jun 2009
    11 Sep 2009
    Link to this post
    Please see video at:
    http://www.screencast.com/users/RichaGupta/folders/Jing/media/06c1e113-769f-4b20-ad3e-8fc0ce625caf

    Is it due the category filter? Can u try the same scenario, i.e. using categories filter as well?

    Thanks
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    24 Sep 2009
    Link to this post
    Hi Richa,

    I tried to reproduce the problem using Category in the statement string but the items was correctly filtered. I tested under Sitefinity 3.7 SP1.

    Below is the exact FilterExpression statements I used - Publication_Date <= "#now" AND Expiration_Date > "#now" AND Category IN ("a") AND Title like "t%"

    Regards,
    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.
Register for webinar
6 posts, 0 answered