SelectedValueChanged Fired Twice

6 posts, 0 answers
  1. renemt
    renemt avatar
    40 posts
    Member since:
    Jul 2007

    Posted 02 Feb 2009 Link to this post

    I'm using RadControls for WinForms 2008.3 1321 (control version 8.2.0.0) and found the following issue:

    The SelectedValueChanged event of the RadComboBox fires two times when the item selection changes. I'm able to reproduce this with the following small WinForms test project:

    Form1.Designer.cs
    namespace RadComboTest 
        partial class Form1 
        { 
            /// <summary> 
            /// Required designer variable. 
            /// </summary> 
            private System.ComponentModel.IContainer components = null
     
            /// <summary> 
            /// Clean up any resources being used. 
            /// </summary> 
            /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> 
            protected override void Dispose(bool disposing) 
            { 
                if (disposing && (components != null)) 
                { 
                    components.Dispose(); 
                } 
                base.Dispose(disposing); 
            } 
            #region Windows Form Designer generated code 
     
            /// <summary> 
            /// Required method for Designer support - do not modify 
            /// the contents of this method with the code editor. 
            /// </summary> 
            private void InitializeComponent() 
            { 
                this.radComboBox1 = new Telerik.WinControls.UI.RadComboBox(); 
                ((System.ComponentModel.ISupportInitialize)(this.radComboBox1)).BeginInit(); 
                this.SuspendLayout(); 
                //  
                // radComboBox1 
                //  
                this.radComboBox1.Location = new System.Drawing.Point(12, 12); 
                this.radComboBox1.Name = "radComboBox1"
                //  
                //  
                //  
                this.radComboBox1.RootElement.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren; 
                this.radComboBox1.Size = new System.Drawing.Size(260, 20); 
                this.radComboBox1.TabIndex = 0; 
                this.radComboBox1.Text = "radComboBox1"
                //  
                // Form1 
                //  
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 
                this.ClientSize = new System.Drawing.Size(284, 264); 
                this.Controls.Add(this.radComboBox1); 
                this.Name = "Form1"
                this.Text = "Form1"
                ((System.ComponentModel.ISupportInitialize)(this.radComboBox1)).EndInit(); 
                this.ResumeLayout(false); 
                this.PerformLayout(); 
     
            } 
            #endregion 
     
            private Telerik.WinControls.UI.RadComboBox radComboBox1; 
        } 
     
     

    Form1.cs
    using System; 
    using System.Diagnostics; 
    using System.Windows.Forms; 
    using Telerik.WinControls.UI; 
     
    namespace RadComboTest 
        public partial class Form1 : Form 
        { 
            public Form1() 
            { 
                InitializeComponent(); 
     
                radComboBox1.Items.Add(new RadComboBoxItem("Item1", 1)); 
                radComboBox1.Items.Add(new RadComboBoxItem("Item2", 2)); 
                radComboBox1.Items.Add(new RadComboBoxItem("Item3", 3)); 
     
                radComboBox1.SelectedValueChanged += new EventHandler(radComboBox1_SelectedValueChanged); 
            } 
     
            void radComboBox1_SelectedValueChanged(object sender, EventArgs e) 
            { 
                Debug.Fail("radComboBox1_SelectedValueChanged"); 
            } 
        } 
     

    Can anybody confirm this issue?

    Regards,
    ReneMT


  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 04 Feb 2009 Link to this post

    Hello renemt,

    Thank you for the providing your code.

    I managed to reproduce the issue. It will be addressed in one of our next releases. For the time being you can use SelectedIndexChanged instead SelectedValueChanged.

    I have updated your Telerik points for the report. Do not hesitate to contact me again if you have other questions.

    Sincerely yours,
    Martin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Fabien
    Fabien avatar
    43 posts
    Member since:
    Sep 2008

    Posted 21 Apr 2009 Link to this post

    deleted, I made a mistake, sorry
  5. gmendez
    gmendez avatar
    82 posts
    Member since:
    Jun 2012

    Posted 29 Jun 2009 Link to this post

    Hello,

    Will this issue be fixed for Q2?
    Best regards,

    Gonzalo
  6. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 02 Jul 2009 Link to this post

    Hello gmendez,

    Thank you for the question.

    Unfortunately, we did not manage to address this issue in Q2 2009 release, which is already available for download. There were a lot of hard tasks with higher priority, as described in the Roadmap.

    Do not hesitate to contact me again if you have other questions

    Best wishes,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  7. gmendez
    gmendez avatar
    82 posts
    Member since:
    Jun 2012

    Posted 02 Jul 2009 Link to this post

    just asking :)
Back to Top
UI for WinForms is Visual Studio 2017 Ready