I have a Telerik RadDropDownList whose auto-complete property is set. The auto complete list display works just fine and I am able to use my mouse to select an item. However, I am unable to iterate through the auto-complete list using my down-arrow key. When the list gets displayed and I hit the down-arrow key once, the first value automatically gets selected. When I hit the down-arrow key again(to iterate to the next element), the application freezes and crashes.
Also, I am not quite sure how the SelectedIndex is suppose to work. In my code below, the event SelectedIndexChanged gets called when there is a change in the index position, however, the PopulateTasks method gets called even before I select an item from the drop-down list.
I tried using
radDropDownList1.SelectedItem.Selected == true
condition to call PopulateTasks method only once an item is selected, but that dosnt seem to work.
Any ideas what I could try?
void PopulateProjects()
{
radDropDownList1.BeginUpdate();
radDropDownList1.DataSource = ditems;
radDropDownList1.DisplayMember = "ProjectName";
radDropDownList1.ValueMember = "ProjectName";
radDropDownList1.DropDownListElement.AutoCompleteSuggest.SuggestMode =
Telerik.WinControls.UI.SuggestMode.Contains;
Size popupSize = new Size(650, 400);
radDropDownList1.DropDownListElement.AutoCompleteSuggest.DropDownList.DropDownMinSize = popupSize;
radDropDownList1.DropDownListElement.DropDownMinSize = popupSize;
radDropDownList1.ListElement.Font = new Font("Microsoft Sans Serif", 16); radDropDownList1.DropDownListElement.AutoCompleteSuggest.DropDownList.Popup.Font = new System.Drawing.Font("Microsoft Sans Serif", 16);
radDropDownList1.EndUpdate();
radDropDownList1.SelectedIndex = 0;
radDropDownList1.Text = "Select Project";
}
My event handler:
private void raddropdownlist1_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
{
if (radDropDownList1.SelectedIndex >1)
{
if (radDropDownList1.SelectedItem.Selected == true)
{
radTaskList.Select();
PopulateTasks();
}
if (this.GetMainForm().IsResetApp)
{
return;
}
}
}