I am using Telerik Raddropdownlist and have set the auto complete mode to suggest. When I type the first character in the text box, say '1', the dropdown suggests all projects starting with 1 which is fine( Lets say the first 2 projects listed after the match1 are 1234 and 1456). However, when I type lets say another '1', the textbox gets appended with "111234" which is basically both the 1s I typed along with the first element in the dropdown. Though the autocomplete mode is suggest and not suggestappend, I have no idea why the first match gets appended.
this.radDropDownList1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
this.radDropDownList1.AutoSizeItems = true;
this.radDropDownList1.DefaultItemsCountInDropDown = 20;
this.radDropDownList1.DropDownHeight = 160;
this.radDropDownList1.DropDownMinSize = new System.Drawing.Size(400, 200);
this.radDropDownList1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F);
this.radDropDownList1.Location = new System.Drawing.Point(803, 23);
this.radDropDownList1.MaxDropDownItems = 10;
this.radDropDownList1.Name = "radDropDownList1";
this.radDropDownList1.RootElement.AutoSize = false;
this.radDropDownList1.Size = new System.Drawing.Size(280, 36);
this.radDropDownList1.TabIndex = 2;
this.radDropDownList1.Text = "Select Project";
this.radDropDownList1.DropDownListElement.AutoCompleteSuggest.DropDownList.Popup.Font = new System.Drawing.Font("Microsoft Sans Serif", 16);
this.radDropDownList1.SelectedIndexChanged += new Telerik.WinControls.UI.Data.PositionChangedEventHandler(this.raddropdownlist_SelectedIndexChanged);
radDropDownList1.DataSource = ditems;
radDropDownList1.DisplayMember = "ProjectName";
radDropDownList1.ValueMember = "ProjectName";
radDropDownList1.AutoCompleteDataSource = ditems;
radDropDownList1.AutoCompleteMode = AutoCompleteMode.Suggest;
Size popupSize = new Size(400, 300);
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);
}
catch (Exception ex)
{
Utils.LogManager.write("Exception occur While populating Projects. error detail: " + ex.Message + "\r\nStacktrace: " + ex.StackTrace, "error");
ExceptionDialog.ShowExceptionDialog(ex);
}
radDropDownList1.SelectedIndex = -1;
radDropDownList1.Text = "Select Project";
private void raddropdownlist_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
{
if (radDropDownList1.SelectedIndex >=0)
{
cbTaskList.Select();
PopulateTasks();
if (this.GetMainForm().IsResetApp)
{
return;
}
}
}
I know theres a lot of redundancy in my code but I had a tough time resizing my AutoSuggest popup and I'm also new to this.
radDropDownList1.DropDownListElement.AutoCompleteSuggest.DropDownList.Popup.Font = new System.Drawing.Font("Microsoft Sans Serif", 16);
was causing it to behave weird. It worked fine once I commented it out.