AutoComplete

1 Answer 92 Views
AutoComplete
Allen
Top achievements
Rank 1
Iron
Iron
Allen asked on 24 Apr 2023, 01:59 AM | edited on 24 Apr 2023, 02:01 AM

Hey Team,

I have question for you. Do we support to open dropdown list when RadAutoComplete gets focus? 

If yes, how could we I it? Can you provide an example here? 

if no, will we add this functionality in the future?

Thanks

Allen

1 Answer, 1 is accepted

Sort by
0
Maria
Telerik team
answered on 24 Apr 2023, 02:08 PM

Hello Allen,

Initially, the suggestions view of AutoComplete is not displayed. When you start typing in the control, the SuggestionView shows the matched results. To achieve the desired behavior you need to invoke the ShowSuggestions method in the Focused event of the control. I am sending you a code snippet below with an example:

XAML code:

 <telerik:RadAutoComplete x:Name="autoComplete" 
                                 Placeholder="Search here..." 
                                 Focused="autoComplete_Focused"/>
And the event in the code behind:
private void autoComplete_Focused(object sender, FocusEventArgs e)
{
    this.autoComplete.ShowSuggestions();
}

Regards,
Maria
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Allen
Top achievements
Rank 1
Iron
Iron
commented on 24 Apr 2023, 11:33 PM

Got it, Thanks for your sharing! One more thing, can we disable AutoComplete Filter rule if we want to show all records? 
Maria
Telerik team
commented on 25 Apr 2023, 08:19 AM

Hello Allen, 

Could you please share why you use the AutoComplete as you want to remove the filtering option. The control filters the items in the suggestion view based on the matched results from the text typed in the control. Calling the ShowSuggestions() on Focus lists all items in the suggestion view (before applying the filtering).

To achieve the desired behavior you can use the RadComboBox control. If you want to show all records without a filter that is the better approach. The control does not have filtering option.

You could check our documentation article for the control here: ComboBox Overview.
For examples of the control, you could check our git repository here: ComboBox examples.

Allen
Top achievements
Rank 1
Iron
Iron
commented on 26 Apr 2023, 05:26 AM

Thanks for your explaining, I was comparing these two components, just want to make sure which one is much better with logic. So basically, they are quite similar in many respects. 
Tags
AutoComplete
Asked by
Allen
Top achievements
Rank 1
Iron
Iron
Answers by
Maria
Telerik team
Share this question
or