Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Editors (TextBox, MaskedEdit, SpinEditor, BrowseEditor, ColorBox) > RadSpinEditor DataBinding Problem

Not answered RadSpinEditor DataBinding Problem

Feed from this thread
  • Naama avatar

    Posted on Mar 2, 2011 (permalink)

    Hello,

    In our application we use RadSpinEditor with binding.

    Now we notice a problem with the binding of the control:

    When we update the control by the keyboard, then leave the control by tab, returning to the spinEditor and updating another value, the new value does'nt save – when leaving the control the last value returns.

    Looking forward to your reply.        


    Here is a sample code:

     

    static class Program
        {
            /// <summary>
            /// The main entry point for the application.
            /// </summary>
            [STAThread]
            static void Main()
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Form1());
            }
        }
        public class Form1 : Form
        {
            List<Class1> l = new List<Class1>();
            public Form1()
            {
                InitializeComponent();
                l.Add(new Class1());
            }
      
            private void Form1_Load(object sender, EventArgs e)
            {
                this.radSpinEditor1.DataBindings.Add("Value", l, "Number");
            }
      
            #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.radSpinEditor1 = new Telerik.WinControls.UI.RadSpinEditor();
                this.button1 = new System.Windows.Forms.Button();
                ((System.ComponentModel.ISupportInitialize)(this.radSpinEditor1)).BeginInit();
                this.SuspendLayout();
                // 
                // radSpinEditor1
                // 
                this.radSpinEditor1.Location = new System.Drawing.Point(77, 39);
                this.radSpinEditor1.Name = "radSpinEditor1";
                // 
                // button1
                // 
                this.button1.Location = new System.Drawing.Point(90, 86);
                this.button1.Name = "button1";
                this.button1.Text = "button1";
                // 
                // Form1
                // 
                this.ClientSize = new System.Drawing.Size(262, 121);
                this.Controls.Add(this.button1);
                this.Controls.Add(this.radSpinEditor1);
                this.Load += new System.EventHandler(this.Form1_Load);
                ((System.ComponentModel.ISupportInitialize)(this.radSpinEditor1)).EndInit();
                this.ResumeLayout(false);
                this.PerformLayout();
      
            }
      
            #endregion
      
            private Telerik.WinControls.UI.RadSpinEditor radSpinEditor1;
            private System.Windows.Forms.Button button1;
        }
      
        class Class1
        {
            int number;
      
            public int Number
            {
                get { return number; }
                set { number = value; }
            }
        }

     

    Reply

  • Peter Peter admin's avatar

    Posted on Mar 7, 2011 (permalink)

    Hello Naama,

     
    Thank you for contacting us.

    I was able to reproduce the described behavior. You can work around it by calling the SpinElement's Validate method on SpinEditor LostFocus event.

    Copy Code
    this.radSpinEditor1.LostFocus += new EventHandler(radSpinEditor1_LostFocus);
         
      
    void radSpinEditor1_LostFocus(object sender, EventArgs e)
    {
           this.radSpinEditor1.SpinElement.Validate();
    }

    Please refer to the modified project. Do not hesitate to contact us if you have other questions.

     

    Regards,
    Peter
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
    Attached files

    Reply

  • Roberto Andrade Olivie avatar

    Posted on Oct 27, 2011 (permalink)

    Hello

    I had the same problem, and this workaround has solved it.

    Are there any plan to solve this issue in a future release?

    Regards
    Roberto

    Reply

  • Peter Peter admin's avatar

    Posted on Oct 31, 2011 (permalink)

    Hello Roberto,

    Yes, we will provide this functionality in our upcoming release.

    Regards,
    Peter
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Editors (TextBox, MaskedEdit, SpinEditor, BrowseEditor, ColorBox) > RadSpinEditor DataBinding Problem
Related resources for "RadSpinEditor DataBinding Problem"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]