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

Highlight no item by default

6 Answers 65 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 05 Aug 2014, 02:36 AM
Can the control be changed to not highlight the first item by default?


In my specific case I use the auto complete for name searching, and often there are multiple matches (e.g. many "john smiths") and it is preferable to never highlight an item, but there is no "CurrentItem" or similar. It is too easy for users to hit enter/tab and "select" the top item, where was what is really wanted is enter/tab to simply run my "search" command. 

Ideally the user must manually highlight or select an item

6 Answers, 1 is accepted

Sort by
0
Alex
Top achievements
Rank 1
answered on 05 Aug 2014, 03:01 AM
Sorry just noticed that HighlightBehaviour

This property satisfies my requirements
0
Kalin
Telerik team
answered on 05 Aug 2014, 07:38 AM
Hello Alex,

For more details about how to implement a custom HighlightBehavior you can check the following article from our online help documentation:
http://www.telerik.com/help/silverlight/radautocompletebox-features-highlightbehavior.html

Hope this helps.

Regards,
Kalin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Michael
Top achievements
Rank 1
answered on 06 Oct 2014, 02:20 AM
Sorry, I am trying to do the exact same thing and I cannot figure out how to achieve this behavior with a HighlightBehavior. How do you have a behavior which does not select an item unless the user manually chooses one? I tried returning -1 in FindHighlightedIndex and that doesn't seem to work.
0
Kalin
Telerik team
answered on 06 Oct 2014, 08:11 AM
Hi Michael,

By returning -1 in the FindHighlightedIndex() method you should be able to achieve the desired. I just tested and it works as expected (nothing is highlighted in this case). However I will ask you to share some sample code, so we can check the issue you are observing and provide further assistance.

I'm looking forward to hearing from you.

Regards,
Kalin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Michael
Top achievements
Rank 1
answered on 06 Oct 2014, 10:57 PM
Thanks for the -1 tip. I did that and it works in all cases except when there is only one item in the filter results. In this case (only one item), the single item is always highlighted. Can this be fixed somehow?
0
Kalin
Telerik team
answered on 07 Oct 2014, 12:45 PM
Hello Michael,

Indeed when there is a single item filtered it always get highlighted even -1 is returned from the custom HighlightBehavior. This behavior is intended by design as whenever there is only one matching item, it is the item that the user would like to select and it automatically becomes highlighted. Currently I'm afraid that behavior cannot be overridden.

If you have any other questions let us know.

Regards,
Kalin
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.

 
Tags
AutoCompleteBox
Asked by
Alex
Top achievements
Rank 1
Answers by
Alex
Top achievements
Rank 1
Kalin
Telerik team
Michael
Top achievements
Rank 1
Share this question
or