Questions tagged [validationrule]
53 questions
10
votes
1 answer
ValidationRule for WPF Textbox
I am newbie to WPF.In my UserControl,I have 8 labels and its respective 8 textboxes as follows:
1.Label : abc 2.Label : def
TextBox1 : TextBox2 :
3.Label :xyz 4. Label : ghi
Textbox3 : TextBox4 :
Each of these textbox text…

Patil
- 173
- 1
- 2
- 6
6
votes
1 answer
WPF Grid With Validation Rule And Dependency Property
At the moment I have a grid and I'm trying to have a cell with validation rules. To validate it, I require the row's min and max value.
Validation Class:
public decimal Max { get; set; }
public decimal Min { get; set; }
public override…

Master
- 2,038
- 2
- 27
- 77
4
votes
0 answers
Custom Validation Rule not found in Namespace
for some reason my program don't find my Custom Validation Rule für my TextBox. I define the namespace where my Validation Rule is located
xmlns:valRule="clr-namespace:MovieDB.UI.Validation"
and i bind my rule to the TextBox

Daniel
- 1,027
- 1
- 8
- 23
4
votes
1 answer
ValidationRule vs Behavior in WPF
Say I am trying to implement a piece of functionality in which a text box only allows integers to be inputted in by the user. I can implement this two ways, using a ValidationRule that checks whatever the user inputs and binding it to the text…

Alexander Ventura
- 1,150
- 1
- 10
- 32
4
votes
1 answer
WPF Validation Errors
In my current projet, I have to deal with data validation in a WPF form. My form is in a DataTemplate in a ResourceDictionnary. I can save and load the data from my form thanks to two buttons, which serialize and deserialize the data (through two…

Max
- 1,810
- 3
- 26
- 37
3
votes
1 answer
How to Test Validation Rule Programmatically in VBA/Access
I have the validation rules set in the design table and I want to test it before I save the changes done in the recordset.

Thor My
- 269
- 2
- 8
- 23
3
votes
2 answers
ValidateWithoutUpdate doesn't ever execute configured ValidationRules?
I'm trying to understand why calls to BindingExpression.ValidateWithoutUpdate() doesn't actually do what it advertises.
I've got some cranky validation (I've removed the boring details from my sample code; suffice it to say it has to do with WF4…
user1228
2
votes
1 answer
Why textbox border red color appears on the panel over textbox
I am under a situation where i have textbox which has to do some validation, Upon validation it show red color border.
The problem is when i hover a panel over the unvalidated textbox, the red color border is still visible on the panel which is over…

testCoder coder
- 53
- 6
2
votes
1 answer
WPF ValidationRule - How to Compare two values with each other
I am newbie in WPF and now I am struggling with its Validation.
In the validate method of my Validation class I need to compare TextBox1's value with TextBox2's both included in my form.
Is there any way to do so in WPF?

amir moradifard
- 353
- 1
- 8
- 26
2
votes
3 answers
Passing value in a TextBox to a ValidationRule
I have two TextBox controls (as follows) and would like to pass the Text of the first TextBox [x:Name="defPointFrom1Txt"] into the ValidationRule [MinIntegerValidationRule] for the second TextBox [x:Name="defPointTo1Txt"] instead of the current…

Harrison
- 3,843
- 7
- 22
- 49
2
votes
1 answer
Can't acces the ValidationParameters on .NET MVC client-side validation
I am coding a custom validation to my .NET MVC 4 application. This is the first validation that uses a parameter, and I'm finding some trouble to get this.
This is my C# code:
ValidationAttribute:
namespace Validations
{
…

Marcos Lima
- 761
- 1
- 10
- 26
2
votes
2 answers
WPF TextBox Red Border Still Displayed After ValidationRule succeeds
I have a textbox with a very simple ValidationRule:

Mike Woolf
- 1,210
- 7
- 11
2
votes
2 answers
Submit ItemsSource of ComboBox to ValidationRule
I would like to hand in my validation class the ItemsSource-object, to check whether the users input (value in handler class) can be found in the list (of ItemsSource)
How I can submit ItemsSource of my ComboBox to the handler class…

peter-70
- 19
- 3
1
vote
1 answer
Field Validation Rule to prevent pasting line breaks from excel into access
I have an access table of vendors, used by many queries and vba. The end users populate the fields (in a form) based on W9 data in Excel, which often contains line breaks (aka character turns, line feeds). If they paste a piece of data which…

Grrly
- 43
- 1
- 1
- 7
1
vote
1 answer
Validation based on existing data in WPF
I need to create a validation node that will return an error if value entered already exists. I have GUI with items that can have their name set. I want to enforce the names to be unique.
So for each validation, I need following two…

Tomáš Zato
- 50,171
- 52
- 268
- 778