This is a migrated thread and some comments may be shown as answers.

Display dropdown at user focus

9 Answers 469 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Jc
Top achievements
Rank 1
Jc asked on 21 Jan 2013, 06:13 AM
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

9 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Jan 2013, 06:59 AM
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.
0
Jc
Top achievements
Rank 1
answered on 21 Jan 2013, 07:26 AM
ok, does the radcombobox have the functionnality to only display the values containing the entered text?

tanx'
0
Princy
Top achievements
Rank 2
answered on 22 Jan 2013, 05:40 AM
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.
0
Jc
Top achievements
Rank 1
answered on 22 Jan 2013, 05:43 AM
Ok, thank you!
0
rick
Top achievements
Rank 1
answered on 29 Jan 2014, 02:29 PM
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
0
Nencho
Telerik team
answered on 03 Feb 2014, 09:31 AM
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.
0
Andy
Top achievements
Rank 1
answered on 21 Mar 2016, 04:12 PM

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.

0
Nencho
Telerik team
answered on 24 Mar 2016, 10:41 AM
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.
0
Andy
Top achievements
Rank 1
answered on 24 Mar 2016, 08:16 PM
Thanks, Nencho!
Tags
AutoCompleteBox
Asked by
Jc
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jc
Top achievements
Rank 1
rick
Top achievements
Rank 1
Nencho
Telerik team
Andy
Top achievements
Rank 1
Share this question
or