Jonathan Allen
Jonathan Allen

Reputation: 70307

WPF: How do I prevent users from entering text in a Textbox data bound to a numeric property?

WPF: How do I prevent users from entering text in a Textbox data bound to a numeric property?

Upvotes: 1

Views: 1429

Answers (1)

Reed Copsey
Reed Copsey

Reputation: 564413

The standard validation will handle this...

You can also use a Behavior or attached property to override TextBox's input to prevent non-numeric numbers from being entered. Here is a sample behavior that does this.

Upvotes: 2

Related Questions