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

item not selecting until i hit enter or click on item.

5 Answers 189 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Hiren
Top achievements
Rank 1
Hiren asked on 13 Jun 2014, 06:56 AM
i have use RadAutoCompleteBox control in asp.net. and  everything working fine but i have one problem.

when i type in autocomplete text both then its show me result in
dropdown and when i click out side of that dropdown (without select any
item from result) then first item automatically selected :(.

i don't need auto selection until i hit enter or click on item.

How can i do it?

Thanks,
Hiren Suthar

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 13 Jun 2014, 08:58 AM
Hi Hiren,

RadAutoCompleteBox provides two different visual representations of its entries. The preferable visualization is set via the InputType property of RadAutoCompleteBox which takes one of the following two values: Token and Text. The default behavior of the control in InputType as Text is that it will select the first item automatically when clicking out side. In order to achieve your scenario please try to set the InputType as Token. Please have a look into this online demo for further reference.

Thanks,
Shinu.
0
Hiren
Top achievements
Rank 1
answered on 13 Jun 2014, 09:34 AM
Hi Shinu,
thanks for your quick reply.

Actually, my concern is related with the dropdown open . at that time the first item is by default selected and when i select out side of dropdown/list then first item select. this is my issue.

i need item will not select until I hit enter or click using mouse.

please find attache video which issue i have faced. and issue is replicate on demo link which you have provided.
Note: i have change extension attached file .wmv to .jpg, so rename it .jpg to .wmv for show video.


Thanks,
Hiren Suthar



0
Plamen
Telerik team
answered on 13 Jun 2014, 10:36 AM
Hi Hiren,

Yes indeed it is how the control works by default. If you can override this behavior if by adding the code below:
<script type="text/javascript">
           Telerik.Web.UI.RadAutoCompleteBox.prototype._populateDropDown =function (data, itemsRendered) {
               var dropDown = this._dropDown,
                   resultCount = data.length;
 
               if (data.length) {
                   dropDown.populate(data, itemsRendered, dataFields);
 
                   if (renderShowAllButton && resultCount >=this.get_maxResultCount()) {
                       dropDown._addShowAllButton();
                   else {
                       dropDown._removeShowAllButton();
                   }
 
                   if (!this.get_enableClientFiltering()) {
                       dropDown.open(this._getDropDownPositionInfo());
                   }
               else {
                   this.clear();
               }
           }
   </script>

Hope this will be helpful.

Regards,
Plamen
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Nitesh
Top achievements
Rank 1
answered on 09 Jun 2015, 06:52 AM
problem in your online demo. Tab key,click outside of the autocompletetextBox item   add into AutocompletetextBox that is wrong.
0
Plamen
Telerik team
answered on 09 Jun 2015, 07:58 AM
Hi,

This functionality is controlled by the HighlightFirstMatch property- if you set it to false the first item will not be highlighted.

Hope this will explain the issue. 

Regards,
Plamen
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
AutoCompleteBox
Asked by
Hiren
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Hiren
Top achievements
Rank 1
Plamen
Telerik team
Nitesh
Top achievements
Rank 1
Share this question
or