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

Forums / Developing with Sitefinity / Search index picker

Search index picker

4 posts, 1 answered
  1. Brett
    Brett avatar
    36 posts
    Registered:
    23 Jul 2010
    17 Jun 2011
    Link to this post
    What I am trying to accomplish is this: I need to create a custom user control that is based on the search box control within Sitefinity that allows the user to select which search index in the module is to be used for the search once they fill in their search term and click the search button. The selection should be via drop down list and should populate with the names of each index as they were created in the administration section of the backend. I am not sure of how to attack this.

    Thanks in advance,
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Jun 2011
    Link to this post
    Hi Brett,

    Here is a sample that shows how to get the name value of all indexes

               indexDropDown.DataSource = IndexingManager.IndexingServices.Values;
               indexDropDown.DataTextField = "Name";
               indexDropDown.DataValueField = "Name";
               indexDropDown.DataBind();
               indexDropDown.Items.Insert(0, new ListItem("SelectItem", string.Empty));

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  3. Brett
    Brett avatar
    36 posts
    Registered:
    23 Jul 2010
    17 Jun 2011
    Link to this post
    Thanks for your quick response Ivan. I need the control to only search on the selected index once chosen as well. How would that tie in to what you have shown me?

    Thanks again.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Jun 2011
    Link to this post
    Hi Brett,

    If you are going to set this from the backend - a control property, this will be one time setup until someone else goes there and change the property manually.

    IF you are going to work on the forontend, you need to filter the datasource that you will use to bind the RadComboBox before it is exposed to the user or persist the selection only for the current login session (by using cookies, session , context variables)

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
4 posts, 1 answered