Hello,
I have a Combobox where i add the items programmatically. In the OnSelectedIndexChanged event i want to save the new selected value. I tried this with the evaluation controls and this worked. Now i've bought the Q1 2009 Developer license, installed them and my code isn't working anymore.
Below is the code of a small testproject i made, reproducing the problem. On PostBack in the Init event the ComboBox.Items is first empty. In SelectedIndexChanged the Combobox.Items is filled again with the number of items i added but both Value and Item properties are empty.
Is there some property i need to set now or use some other events?
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> |
| <telerik:RadComboBox ID="RadComboBox1" Runat="server" |
| oninit="RadComboBox1_Init" |
| onselectedindexchanged="RadComboBox1_SelectedIndexChanged" |
| AutoPostBack="True" > |
| </telerik:RadComboBox> |
| <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> |
| protected void RadComboBox1_Init(object sender, EventArgs e) |
| { |
| RadComboBox1.Enabled = true; |
| if (!Page.IsPostBack) |
| { |
| RadComboBox1.Items.Clear(); |
| RadComboBox1.Items.Add(new RadComboBoxItem("Item 1", "1")); |
| RadComboBox1.Items.Add(new RadComboBoxItem("Item 2", "2")); |
| RadComboBox1.Items.Add(new RadComboBoxItem("Item 3", "3")); |
| RadComboBox1.Items.Add(new RadComboBoxItem("Item 4", "4")); |
| RadComboBox1.Items.Add(new RadComboBoxItem("Item 5", "5")); |
| } |
| } |
| protected void RadComboBox1_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) |
| { |
| Label1.Text = RadComboBox1.SelectedItem.Text + " : " + RadComboBox1.SelectedItem.Value; |
| } |