不能在验证时将焦点设置在usercontrol网格文本框上. [英] Cant able to set the focus on usercontrol grid textbox while validating.

查看:77
本文介绍了不能在验证时将焦点设置在usercontrol网格文本框上.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我非常需要解决以下问题的方法.如果您知道,请告诉我.

我有WPF用户控制项目.在Page1.xaml上,我有wpf usercontrol ucGrid1.此ucGrid1没有.文本框txtBox1,txtBox2,txtBox3等.

根据业务逻辑,一旦用户在用户控件的文本框中输入值(在Page1.xaml上),我将验证txtBox1,txtBox2,txtBox3值.如果输入了任何错误的值,则需要将焦点设置在txtBox1上.

我无法将焦点设置在usercontrol的文本框上.如果您有任何解决方案,请告诉我.


谢谢,
Sripriya B,
钦奈.

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.

推荐答案



那时将变量与文本框绑定时,您可以提及规则和逻辑以检查基本验证,如链接贝娄中所述:

Validation.ErrorTemplate

完成所有文本框条目后再检查它,最好在输入数据时进行验证.


问候,
达山.
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.


这篇关于不能在验证时将焦点设置在usercontrol网格文本框上.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆