Click here to Skip to main content
15,885,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am very desperately needed solution to below problem.If you know please let me know.

I have WPF usercontrol project. On Page1.xaml I have wpf usercontrol ucGrid1. This ucGrid1 is having no. of textboxes txtBox1,txtBox2,txtBox3 etc.

As per business logic once user entered values in user control's textboxes (on Page1.xaml), i will validate txtBox1,txtBox2,txtBox3 values. if any wrong value entered i need to set the focus on txtBox1.

I am not able to set the focus on usercontrol's textbox. if you have any solution please let me know.


thanks,
Sripriya B,
Chennai.
Posted
Comments
Amir Mahfoozi 14-Jul-12 2:43am    
Please provide the code that validates inputs and take the focus on invalid text box.

1 solution

Hi,

When you are binding the variables with the textboxes at that time you could mention rule and logic to check for the base validation as explained in link bellow:

Validation.ErrorTemplate

Rather then checking it once all of the textbox entries are done, it's better to validate just while entering Data.


Regards,
Darshan.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900