This is a migrated thread and some comments may be shown as answers.

RadMaskedTextInput - LostFocus - GotFocus

4 Answers 210 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
ITA
Top achievements
Rank 1
ITA asked on 04 Jun 2012, 02:18 PM
Hi,

how can i add a errorhandling to a RadMaskedTextInput? On LostFocus-Event i check if the Input is ok or not. If the
Input is not ok, i want to clear the RadMaskedTextInput and set the Cursor back in the box.

To clear is no problem:

RadMaskedTextInput.Text = "";

But how to set the Focus?

RadMaskedTextInput.Focus(); does not work.

Thanks Best Regards
Rene

4 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 07 Jun 2012, 07:03 AM
Hello Rene,

 Could you please send us your XAML configuration? This way we would be better able to advice you on how to set the focus successfully. On the other hand, this is not typical validation scenario. Usually a red border occurs and does not disappear until a valid input is written and there is no automatic deletion of input. I guess you know our validation samples and help article. Hope they can be useful to you.

Kind regards,
Petar Mladenov
the Telerik team

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

0
Diego
Top achievements
Rank 1
answered on 14 Aug 2013, 05:25 PM
Hi,

I got a question related to this thread.

I Got a RadMaskedTextInput inside a RadTreeviewItem (i don't know if its relevant but i populate this tree with HirerachicalTemplate MVVM), if i select another item in the radtreeview i got to validate that the RadMaskedTextInput is not empty, if its empty the RadTreeviewItem must be selected again and the RadMaskedTextInput bus be Focused again. I'm trying to set focus to the RadMaskedTextInput through code behind, but it doesnt seems to work. Do you have any advise for me?


thanks in advance.
0
Petar Mladenov
Telerik team
answered on 19 Aug 2013, 07:04 AM
Hello Diego,

 To better indicate the real issue, could you please elaborate more on your scenario ?

  • Do you use the MaskedTextInput in ItemEditTemplate or simply ItemTemplate ? Could you please send us the XAML of the template used?
  • Is your TreeView editable ?
  • On which event do you perform the focusing code ? Does this code work on a simple Button CLick ?
Actually you can take advantage of our 24h priority support by sending a support ticket. You will be able to attach a reproducible isolated project that we can investigate better.
Regards,
Petar Mladenov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Diego
Top achievements
Rank 1
answered on 22 Aug 2013, 04:18 PM
Hi the problem was with the virtualization of the treeview, i added a dispatcher, and that was pretty much it. 
thank you very much!
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
ITA
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Diego
Top achievements
Rank 1
Share this question
or