0

Is it possible to automatically highlight the first item of the list created by the Ajax Control Toolkit's AutoCompleteExtender?

I would like the first item to be highlighted the same way it would be if the user presses down key when the textbox is selected and the autocomplete list is visible. This would make the textbox be filled with the highlighted value if the user presses tab afterwards.

This is the code for the basic AutoCompleteExtender field:

<asp:TextBox ID="namebox" runat="server"></asp:TextBox>


<cc1:AutoCompleteExtender ServiceMethod="GetNames"
    MinimumPrefixLength="1"
    CompletionInterval="100" EnableCaching="false" CompletionSetCount="10"
    TargetControlID="namebox"
    ID="AutoCompleteExtender1" runat="server" FirstRowSelected="false"
    OnClientItemSelected="HandleChange_Name"
    >
</cc1:AutoCompleteExtender>
Simo Kivistö
  • 4,247
  • 3
  • 38
  • 42

1 Answers1

0

Seems that I completely missed the option firstRowSelected property already visible in the code of the question. It was enough to set it to true.

Eventually I found this reading the documentation in the AutoCompleteExtender Wiki page on GitHub.

Simo Kivistö
  • 4,247
  • 3
  • 38
  • 42