Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > MaskedTextBox > Setting RadMaskedTextBox Value on Loaded event is triggering ValueChanged and ValueChanging multiple times

Not answered Setting RadMaskedTextBox Value on Loaded event is triggering ValueChanged and ValueChanging multiple times

Feed from this thread
  • Tony avatar

    Posted on Oct 12, 2011 (permalink)

    Update - I ended up checking ValueChanging to ensure that the event is marked as handled if e.NewValue has the same value as that currently on the actual control.

    Thanks for looking.

    Hi,

    I am using the RadMaskedTextBox to create a new user control.  The value of the textbox (let's call this amountMaskedTextBox) is a 2-way binding against a Property (let's call this Amount) which in turn is backed into a DependencyProperty (let's call this AmountProperty). 

    The UpdateValueEvent of the textbox is set to "PropertyChanged" as I need to check each key entry [made by the user].

    The textbox has the following events:
    * ValueChanged
    * ValueChanging
    * GotFocus
    * LostFocus
    * Loaded

    On the Loaded event, I am setting the value of the textbox as the value of Amount formatted as ##,###.## (i.e. amountMaskedTextBox.Value = Amount.ToString("N2");).  However, I am finding that this is triggering the ValueChanging and ValueChanged events multiple times which is then replacing my formatted text (e.g. 10,000,000.00) with the raw data (e.g. 10000000).

    Any ideas why this is the case?

    NB. I am not able to make the MaskType Numeric (with a Mask of n2) as I need to allow users to be able to enter certain special characters.

    Thanking you for your assistance,

    Tony

    Reply

  • Petar Mladenov Petar Mladenov admin's avatar

    Posted on Oct 17, 2011 (permalink)

    Hello Tony,

     We were unable to reproduce this issue. Could you please elaborate more on your scenario, any sample code will be highly appreciated? This way we could investigate this and advice you better. Thank you in advance.

    Kind regards,
    Petar Mladenov
    the Telerik team

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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > MaskedTextBox > Setting RadMaskedTextBox Value on Loaded event is triggering ValueChanged and ValueChanging multiple times
Related resources for "Setting RadMaskedTextBox Value on Loaded event is triggering ValueChanged and ValueChanging multiple times"

Silverlight MaskedTextBox Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]