I've created AutoCompleteBox in code behind and I'm using AutoCompleteBox.DataSourceSelect to get suggested values into a dropdown. By using up & down arrow keys I can move through the suggest list.
When I'm at:
- the last element in the list and I'm pressing down arrow key I do not want the list to go back to the first element - I want the list to stop at the last element no matter what,
- the first element in the list and I'm pressing up arrow key I do not want the list to go back to the last element - I want the list to stop at the first element no matter what.
How can I implement this 'prevention' in the OnClientLoad() event?
Here's a fragment of my code:
var autoCompleteBox = new Telerik.Web.UI.RadAutoCompleteBox
{
AllowCustomEntry = true,
AutoPostBack = false,
Delimiter = ",;\n",
DropDownPosition = Telerik.Web.UI.RadAutoCompleteDropDownPosition.Static,
EnableClientFiltering = false,
Filter = Telerik.Web.UI.RadAutoCompleteFilter.StartsWith,
HighlightFirstMatch = true,
InputType = Telerik.Web.UI.RadAutoCompleteInputType.Token,
MinFilterLength = 0,
MaxResultCount = 100,
};
autoCompleteBox.OnClientEntryAdded = "AutoCompleteBox_OnClientEntryAdded";
autoCompleteBox.OnClientRequesting = "AutoCompleteBox_OnClientRequesting";
autoCompleteBox.OnClientLoad = "AutoCompleteBox_OnClientLoad";