Display dropdown at user focus

10 posts, 0 answers
  1. Jc
    Jc avatar
    25 posts
    Member since:
    Sep 2012

    Posted 21 Jan 2013 Link to this post

    Hi guys,

    I'm using "RadControls for ASP.NET AJAX Q3 2012 and I'd like to know how to do the following functionnality:

    Is there any way to open dropdown with available values at user focus, without having to type any letters?

    Thanks for your help.
    JC
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 Jan 2013 Link to this post

    Hi,

    The RadAutoCompleteBox control is populated with data, base on the entered in the input text. Therefor, opening the DropDown, when the control is focused would display an empty DropDown, which I believe is not the intended scenario. I can suggest you to use the RadComboBox control, which would fit the requirements of your scenario.

    Regards,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jc
    Jc avatar
    25 posts
    Member since:
    Sep 2012

    Posted 21 Jan 2013 Link to this post

    ok, does the radcombobox have the functionnality to only display the values containing the entered text?

    tanx'
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 Jan 2013 Link to this post

    Hi,

    You can use Load on Demand feature of RadComboBox to achieve your scenario. Following is the sample code.

    ASPX:
    <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="250" Height="150" EmptyMessage="Select a Company" DataSourceID="SqlDataSource1" DataTextField="CompanyName DataValueField="CompanyName" EnableAutomaticLoadOnDemand="True" ItemsPerRequest="10" ShowMoreResultsBox="true" EnableVirtualScrolling="true" >
    </telerik:RadComboBox>

    Please take a look into this documentation and demo for more information.

    Hope this helps.

    Regards,
    Princy.
  6. Jc
    Jc avatar
    25 posts
    Member since:
    Sep 2012

    Posted 21 Jan 2013 Link to this post

    Ok, thank you!
  7. rick
    rick avatar
    3 posts
    Member since:
    Jan 2014

    Posted 29 Jan 2014 in reply to Princy Link to this post

    HI,

    I could also use a feature that allows the RadAutoCompleteBox to load all values without having to input any text,
    but i can´t use RadComboBox because i am also using tokens and multiple selection.

    I even tried using MinFilterLength="0" but it didn't work.

    Are there any alternatives?

    Thank you
  8. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 03 Feb 2014 Link to this post

    Hello Rick,

    We recently introduced a new feature of the RadAutoCompleteBox - ClientFiltering. With this feature enabled, the RadAutoCompleteBox is initially supplied with the underlying DataSource. Therefore, this functionality allows your scenario to be achieved. I have prepared a sample project for you, demonstrating the implementation of a possible approach of achieving the desired functionality. Please find the attachment. In addition, here you could find our online demos, regarding the usage and the benefits of the ClientFIltering. 

    Note : dll files are removed from the attachment.

    Regards,
    Nencho
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
  9. Andy
    Andy avatar
    54 posts
    Member since:
    Jun 2009

    Posted 21 Mar Link to this post

    Hi,

    Is it possible to expand dropdown when text input gets the focus? I downloaded the project with solution suggested by Nencho, but first of all it expands dropdown list on initial load of the page and also needs to have client filtering enabled, which I'm trying to avoid.

    Alternatively drop-down button to open the list would be nice, similar to the combobox, would work too. I think it would be useful in many cases when user needs to select from a list of items, but doesn't know initially what they are, so currently he has to guess.

    I know that the described functionality is provided by combobox, but it doesn't support selection of multiple items and displaying them as tokens, which is done very nicely by autocompletebox.

    Thank you.

  10. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 24 Mar Link to this post

    Hello Andy,

    Due to the enhancements of the control, you can easily achieve the desired functionality, by handling the focus event with jQuery and use the query() function of the AutoCompleteBox in the following manner:

      <script type="text/javascript">
          var $ = $telerik.$;
          function pageLoad() {
              $(".racInput").on("focus", function (e) {
                  var autoComplete = $find("AutoCompleteBox1");
                  autoComplete.query(" ");
     
              })
          }
    </script>


    Regards,
    Nencho
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  11. Andy
    Andy avatar
    54 posts
    Member since:
    Jun 2009

    Posted 24 Mar in reply to Nencho Link to this post

    Thanks, Nencho!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017