
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; |
| } |
| <telerik:RadNumericTextBox Font-Size="11px" ShowSpinButtons="True" Type="Percent" Width="60px" Height="8" |
| ID="txtdiscount" MaxValue="100.00" Value="5.50" MinValue="0.00" MaxLength="5" |
| runat="server" Culture="English (United States)" InvalidStyleDuration="100"> |
| <NumberFormat AllowRounding="false" /> |
| </telerik:RadNumericTextBox> |

| <EditFormSettings UserControlName="~/editform.ascx" EditFormType="WebUserControl" > |
| <EditColumn UniqueName="EditCommandColumn"> |
| </EditColumn> |
| </EditFormSettings> |
| <pages validateRequest="true" theme="Original"> |
var
params = editor._dialogParameters;
var SelectedChar = window.showModalDialog(params["CurrentWebBaseUrl"] + "/_layouts/MySpecialCharacters.aspx", "XYZchars", "center:yes;dialogWidth:600px;dialogHeight:600px;resizable:1");
if (SelectedChar && SelectedChar.length > 0) {
editor.pasteHtml(SelectedChar);
}
</code>| private void UpdateProgressContext(UploadedFile file) |
| { |
| const int total = 100; |
| RadProgressContext progress = RadProgressContext.Current; |
| DateTime startTime = DateTime.Now; |
| for (int i = 0; i < total; i++) |
| { |
| progress.PrimaryTotal = FileHelper.GetFileSize(file.ContentLength); |
| progress.PrimaryValue = i; //TODO: file size |
| progress.PrimaryPercent = i; |
| progress.CurrentOperationText = file.GetName(); |
| TimeSpan elapsed = DateTime.Now.Subtract(startTime); |
| progress.TimeElapsed = string.Format("{0:D2}:{1:D2}:{2:D2} s", elapsed.Hours, elapsed.Minutes, elapsed.Seconds); |
| double estimatedMillisecons = 24 * 60 * 60 * 1000; |
| if (i != 0) |
| { |
| estimatedMillisecons = total * elapsed.TotalMilliseconds / i; |
| } |
| TimeSpan estimated = TimeSpan.FromSeconds(1); |
| if (estimatedMillisecons > 1) |
| { |
| estimated = TimeSpan.FromMilliseconds(estimatedMillisecons); |
| } |
| progress.TimeEstimated = string.Format("{0:D2}:{1:D2}:{2:D2} s", estimated.Hours, estimated.Minutes, estimated.Seconds); |
| double speed = 0.0d; |
| if (elapsed.TotalSeconds > 0) |
| { |
| speed = i / elapsed.TotalSeconds; |
| } |
| progress.Speed = string.Format("{0:0.00}", speed); |
| if (!Response.IsClientConnected) |
| { |
| //Cancel button was clicked or the browser was closed, so stop processing |
| break; |
| } |
| //Stall the current thread for 0.1 seconds |
| System.Threading.Thread.Sleep(100); |
| } |
| } |
