开发者

How to do validation while databinding?

How can I do validation and stop databinding when validation failed?

for example, if a user type 1234 for a firstName texbox which has the 开发者_开发知识库following binding: this.textBoxFirstName.DataBindings.Add("Text", personObj, "FirstName");

Thanks!


Use BindingComplete and/or Parse events of Binding class.

Or use control's validation functionality, which is preferable. Or use some kind of mask editor. Mask editor would be better from the usability point of view.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜