In order to select an item, pressing the key associated with the first letter of the item's text, it is appropriate to use the RadListView.PreviewKeyDown event. Here is a sample code snippet, demonstrating how to select the first found item, starting with the pressed key:
Keys savedKey;
Queue<ListViewDataItem> queue = new Queue<ListViewDataItem>();
foreach (ListViewDataItem item in radListView1.Items)
{
if (item.Text.StartsWith(e.KeyData.ToString()))
{
queue.Enqueue(item);
}
}
if (queue.Count > 0)
{
ListViewDataItem itemToSelect = queue.Dequeue();
radListView1.SelectedItem = itemToSelect;
queue.Enqueue(itemToSelect);
}
savedKey = e.KeyData;
}
else if (queue.Count > 0)
{
ListViewDataItem itemToSelect = queue.Dequeue();
radListView1.SelectedItem = itemToSelect;
queue.Enqueue(itemToSelect);
}
}
I hope this information helps. Should you have further questions, I would be glad to help.
Regards,
Desislava
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.