Error in NumericUpDown and TabControl

3 posts, 0 answers
  1. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 20 Apr 2012 Link to this post


    I'm facing an error when using RadNumericUpDown and RadTabControl.

    I have a TabContol with a few TabItems. On each TabItem I have placed some NumericUpDown controls. Changing selected tab item causes a fatal error whenever a RadNumericUpDown has the focus. The error is a fatal one, "trying to read write protected memory". Via intellitrace, I've been able to confirm that the error is produced on the OnLostFocus method. The TabItem change forces a LostFocus, on this event, RadNumeriUpDown tries to update the inner TextBox and I suspect that, due the tab change, is already disconnected from visual tree.
  2. Boyan
    Boyan avatar
    758 posts

    Posted 25 Apr 2012 Link to this post

    Hi Dani,

    I tried with a simple project RadTabControl with some TabItems and in all of them 2-3 RadNumericUpdowns but I was not able to reproduce the bad behavior. Is something specific that you are doing?

    It will be best if you could send us a simple project or a code snippet. This will greatly help us reproduce the error.

    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft R3 2016 release webinar banner
  4. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 25 Apr 2012 Link to this post

    Hello Boyan,

    tanks for your interest. It's a strange issue. Finally I could solve it. It seems its related to DataBinding on Styles. I created some default custom styles for some controls in my view. It's a bit complicated to explain but it was useful to me to define DataBindings on the style to reuse it and save some coding. I was doing exactly the same in Silverligt 4 but with a custom "Style Data Binding" implementation as silverlight didn't support binding on style setters until version 5. After upgrade to Slv 5, I decided to use the internal Style DataBinding system as I suposed it would be more efficente and elegant. But it started to appear this error, and not only with RadNumericUpDown control, often, after several content switches, suddenly I got cast exception on bindings that was running previously.
    Undoing this change and returning back to my old custom style data binding implementatio solved all these errors.

Back to Top