wpf-validationrules

Programmatically change validation rule in WPF TextBox

I have a text input area defined like this: <TextBox> <TextBox.Text> <Binding Path="MyProperty"> <Binding.ValidationRules> <valid:MyValidator/> </Binding.ValidationRules> </Binding> </TextBox.Text> </TextBox> My problem is that, dependi...

How to do wpf datavalidation with Ado.net

How can i use data validation mechanisms with ado.net datatable or datasets. I have an input form which i am binding to a datatable.Now i want to do input validation how can i do that.I have tried using validationRules but i cant bind parameters to it.I tried using idataerrorinfo but cant get a clue.can someone provide some input..? ...

IDataErrorInfo vs ValidationRule vs Exception

Can anyone tell me which is a better approach for Validation in WPF. 1. Implementing IDataErrorInfo 2. Creating ValidationRule 3. Throwing Exceptions in terms of performance, memory leaks, code maintainability and re-use. ...

Multiple Validation Rules and Validation Templates in WPF

Does anyone have a tactic for dealing with multiple validation rules and templates for those validation rules. Example: I want to have two validation rules (required & data) I want either... One template that can change is display depending on which rule is fired or Two templates, which get displayed depending on which rule is fired ...

WPF: Can the model trigger validation?

Is there a way for a model to explicitly cause validation to occur? I'm particularly interested in causing row-validation in a DataGrid. ...

WPF DataGrid - How do I use cell and row validation with DataGridTemplateColumn

How do I use cell and row validation with DataGridTemplateColumn? <DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding DataType}"/> </DataTemplate> </DataGridTemplateColumn.CellTemplate> ...

How to write a comma separated numbers regular expression validation for wpf textbox

Hello Good people i'm developing a WPF (.NET 3.5) application where i need to validate atextbox with a regular expression to match Empty textbox or text like 02145 or 05145 or 02145,05879,02445. the expression i use is ^(0(2|5)[0-9]{3})?((,0(2|5)[0-9]{3})*?)$. It almost works just that i won't let me have empty textbox. here is som...

ValidationRules on a ListView's bound items

My actual scenario is this: I have a ListView and a custom UserControl setup in a master-detail. It is possible, through a menu item, to add multiple items that are initially invalid. What I'd like to do is, eventually, prevent submission if any items in the list are invalid. Short term, I'm trying to give a visual clue to the item tha...