Hi there, I'm using ultracomboeditor with dropdownstyle set to 'DropDownList'. Also I have set the autocomplete mode to "Append'.
My drop down has the following values: eg. Value set to intger eg. "1", display text set to eg. "1. test1"
Following are sample display text values:
1. test1
2. test 2
3. test 3
4. test 4
11. test 11
26. test 26
30. test 30
31. test 31
32. test 32
33. test 33
34. test 34
When the form loads, I key in "2" in the dropdown and it goes to the "26. test26" value which is correct. Then i key in "3" in the dropdown, which then it will go straight to "30. test 30" but NOT to "3. test 3". I want when I'm in 26, and when i press '3', it should go to "3. test 3".
Is it the normail behaviour?? Why cant we go to the top of the list to search?
my code: this.uComboBillingGroup.AutoCompleteMode = Infragistics.Win.AutoCompleteMode.Append;
this.uComboBillingGroup.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList;
this.uComboBillingGroup.DataSource = dt; this.uComboBillingGroup.ValueMember = "group_id";
this.uComboBillingGroup.Value = bill_id;
this.uComboBillingGroup.DisplayMember = "description";
Could u please be able to help me with a solution ASAP??
Thanks in Advance!! NW
Hello,
Could you please try the following code and let me know if it works for you:
private void ultraComboEditor1_KeyPress(object sender, KeyPressEventArgs e)
{
if (!ultraComboEditor1.Text.ToString().StartsWith(e.KeyChar.ToString()))
ultraComboEditor1.SelectedItem = ultraComboEditor1.ValueList.FindByDataValue(e.KeyChar.ToString());
}
Hi Boris,
Thanks alot for your reply.
Actually I did a small change and then it worked!!
if (!ultraComboEditor1.Text.ToString().StartsWith(e.KeyChar.ToString())) { if(ultraComboEditor1.ValueList.FindByDataValue(e.KeyChar.ToString()) != null) ultraComboEditor1.Text = ultraComboEditor1.ValueList.FindByDataValue(e.KeyChar.ToString()).DisplayText; }
Thanks again!
NW