Oct 15, 2008, 5:25 AM
[OPEN] Default value in a Combo Box
Hi i have a combobox which looks like the code example, I have 2 problems with it:
1. I cant get a default value to be set in the combo.
2. The user is able to enter a value from the keybord, for example "10", but when i try to fetch the selected value, the selected item is -1. "string strValue = cbTest.Item.[cbTest.SelectedIndex].Text;"
Best regards
Mikael Jürke
1. I cant get a default value to be set in the combo.
2. The user is able to enter a value from the keybord, for example "10", but when i try to fetch the selected value, the selected item is -1. "string strValue = cbTest.Item.[cbTest.SelectedIndex].Text;"
<ext:ComboBox Width="70" ID="cbTest" runat="server" />
for (int i = 1; i <= 40; i++)
{
Coolite.Ext.Web.ListItem liItem = new Coolite.Ext.Web.ListItem();
liItem.Value = i.ToString();
liItem.Text = i.ToString();
cbTest.Items.Add(liItem);
}
How do I solve this?Best regards
Mikael Jürke