StackOverflow on BindingValidation_Error if arrow keys not textbox used

4 posts, 1 answers
  1. Ian
    Ian avatar
    51 posts
    Member since:
    Apr 2009

    Posted 26 May 2009 Link to this post

    Setting a BindingValidation_Error event only works correctly for values entered via the textbox. For the same value entered using the up/down arrow buttons the code goes into a loop, adding and then removing, adding and then removing the error condition.

    When an invalid value is set using the text box the event is raised once with ValidationErrorEventAction set to Added. But if the same invalid value is set using the arrow keys the BindingValidation_Error event is raised first with Added, then immediately with Removed, then with Added, then with Removed until a StackOverflow error occurs. 

    I'd like to think my code is at fault but can think of no scenario where the way the binding error is handled should be so different just because different parts of the UI are used to set the same invalid value.

    This bug is on top of the others discovered so far:
    - For currency items the control displays a currency symbol, but although there is a property NumberFormatInfo.CurrencySymbol this property does nothing to the UI when set, making the control useless where you want the user to be able to select the currency they want to use.
    - The number of decimal places cannot be set in XAML and has to be set from code. Bizarrely setting it for one Up/Down control appears to set it for all of them!
    - The Maximum value must be set before the Minimum value in the XAML or the arrow keys don't work.
  2. Answer
    Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 28 May 2009 Link to this post

    Hello Ian,

     I was unable to reproduce the problem. Could you please open a support ticket and send a simple project so I can reproduce it?

     About the other issues:

    • There is a with NumberFormatInfo.CurrencySymbol which prevents from setting the proper symbol. We are using Microsoft's class not ours for this. The good thing is that there is two very simple workarounds:
    1. You can use CustomUnit property and set whatever you want, for example
    numeric1.CustomUnit= "$"       and it will show at the end of the value.

    2.Or set :
            CultureInfo culture = new CultureInfo("fr-fr"); 
                radnumeric3.NumberFormatInfo.CurrencySymbol = culture.NumberFormat.CurrencySymbol; 


    • This is known problem, it is on our To Do list and will try to fix it in near future.
    • This is also known, however this appears only when you make your own style and set it to the RadNumericUpDown control, if you don't use style and just add it to the control this issue will not appear. This problem is  part of the Silverlight framework. Creating your own style and setting it to a multiple numeric controls is a good practice to the extent that you save code. Unfortunately, the RangeBase class provided by the Silverlight Framework seems to have some problems with its coercing of Minimum and Maximum values when set in Style

     Thank you for your time and I am waiting for project to try and help with BindingValidationError.

    Sincerely yours,
    Boyan
    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.
  3. DevCraft banner
  4. Ian
    Ian avatar
    51 posts
    Member since:
    Apr 2009

    Posted 28 May 2009 Link to this post

    Thanks for the response.

    I need to cut down the current application to a simple scenario before sending you code and will try and find time to do so over the next day or two, as I'm way behind on other priorities (testing the chart functionality with real data) and may have a workaround for our specific scenario anyway.

    Re: the currency symbol I'd developed my own workaround which involved changing the value to be numeric and moving the currency to the corresponding label, but I like your solution better and will probably give it a go when I've made progress on other issues.

    Cheers,
    Ian
  5. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 29 May 2009 Link to this post

    Hi Ian,

    I am waiting for the code and I will be glad to help. Thank you for your time and efforts. I also added Telerik points for your involvement.

    Sincerely yours,
    Boyan
    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.
Back to Top