Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
49 views

In WPF app form validation errors not showing up in UI

I'm new to WPF and I need to create a small app in .NET8 that generates text files. In UI I want to have two mandatory fields, one of them accepting only numbers greater than 0. I used fluent ...
Ceres's user avatar
  • 73
0 votes
1 answer
119 views

Validation ErrorTemplate shows on `ContentControl` instead of `TextBox`

Problem I'm trying to generate visual feedback on the result of validating a TextBox input control with the following requirements: A red box is displayed around the textbox border Any error messages ...
user1229658's user avatar
0 votes
1 answer
275 views

MVVM Toolkit Data Validation and ObservableProperty

I'm working in WPF and using the MVVM community toolkit. Reading the documentation, I understand that I can make validation work by inheriting from ObservableValidator and using this pattern for my ...
Mike Heggie's user avatar
-1 votes
1 answer
44 views

How do I use validation to prevent a user from duplicating Datagrid value?

I am trying to figure out how to prevent users from adding or renaming fields in a datagrid, if the value they choose is a duplicate. For example, if there is a directory of Person objects, if someone ...
user613832's user avatar
0 votes
3 answers
6k views

MVVM Community Toolkit: Using ObservableValidator with non-string properties

I have a WPF application that uses the ObservableValidator to handle validation of properties using data annotations. This works great for string properties. For example: public class LoginViewModel : ...
hackeyzach's user avatar
-1 votes
1 answer
40 views

Insert same value in textbox 2 times and checking the values are the same WPF

i'm trying to implement a feature of a textbox in wpf so that a value need to be inserted 2 times to be accepted as the value, otherwise i need to show an errore like validation error or so. I need to ...
Pomodoro's user avatar
2 votes
1 answer
538 views

WPF Validate custom objects in ViewModel

I am using Mvvm Community Toolkit's ObservableValidator for validating viewmodel properties. When there is some custom object in my view model that is bind to the view, how to validate all of these ...
salttoinjury's user avatar
0 votes
0 answers
169 views

wpf - how to use an underlying control's validation template for an user control

I have a user control that consists of a textblock and a textbox and if I validate via INotifyDataErrorInfo the underlying data the whole control gets a red border: How it looks like I would like to ...
Marcel L's user avatar
0 votes
1 answer
309 views

How to get the result of a ValidationResult method, inside ViewModel? (True / False)

I have an (part of) XAML file like this <TextBox.Text> <Binding Path="MyProperty" ...
aca's user avatar
  • 1,121
0 votes
0 answers
71 views

Why does my TextBox dosent work properly, when I want make the border red, if input is invalid?

basiclly the input of the TextBox is an articel number, and if the number is older then 6 Month I want to mark the border of my textbox red. For that I need to get data from an SQL Query btw. The Code ...
NadiaBallshek's user avatar
0 votes
0 answers
106 views

DataTable bound to WPF DataGrid Validation in MVVM

I am working on app and part of it is: load data from SQL database to DataTable (in ViewModel); provide DataTable data to user (in View) using binding to DataGrid ItemsSource; user can edit/add/...
Michal Granát's user avatar
1 vote
1 answer
109 views

How to change a parent by validating a child?

I have a DockPanel that is composed of a button and a textbox. These controls are enclosed by a border. Now I would like to validate the textbox and change the color of the border if the validation ...
lkjasd2's user avatar
  • 84
1 vote
0 answers
41 views

Unblock row editing on WPF DataGrid

I have validation in DataGrid. I am copying and trying to paste multiple rows. But if there is a validation error in one of the rows on insertion, the validation will will be called in and disable ...
DiMaAgalakov's user avatar
0 votes
1 answer
347 views

How to get when the validation state has changed in wpf?

Hi have an application that uses MVVM, there are 3 textboxes in the XAML all of which need to be not null, and there is a button that's submit at the bottom, I've already implemented a validator so ...
mtki's user avatar
  • 1
0 votes
1 answer
248 views

Validation when pressing button

I created validation in WPF with the help of a ValidationRule : public class EmptyValidationRule : ValidationRule { public override ValidationResult Validate(object value, CultureInfo cultureInfo) ...
user7849697's user avatar
0 votes
2 answers
474 views

Handling could not be converted values for double property in WPF

Situation I have textbox, that is binded to a property with a type of double. When the use tries to input a letter into the box, this shows up: And also, this shows up in binding failure. I ...
DeveloperLV's user avatar
  • 1,771
0 votes
1 answer
307 views

WPF, mvvm validation and ui interaction

I'm writing a WPF application using MVVM. I'm trying to understand how to use correctly this pattern for what concern validation. For example, my application will manage data about articles. When a ...
davides77's user avatar
1 vote
1 answer
580 views

Cross property validation using INotifyDataErrorInfo not working

I'm trying to implement validation in my MVVM project, with validation done at Model. Below is a minimal example: View: Window x:Class="Test.MainWindow" xmlns="http://schemas....
Jai's user avatar
  • 8,343
0 votes
1 answer
551 views

validation with validation rules in WPF on button click

I have a view with a standard validation rule. It works as expected, if I tpye some text in the field, and then delete it, error icon and text are showing. Now, I would like to have the logic, if the ...
derstauner's user avatar
  • 1,786
-1 votes
1 answer
297 views

Data Validation in Observable Collection child

I want to have a list of properties of different types. Each property (e.g. BoolProperty, StringProperty,..) derives from the PropertiesBase class. PropertiesBase class has the member PropertyName. So ...
MaxWolodin's user avatar
1 vote
2 answers
231 views

Invalid value passes validation in wpf datagrid, when "Esc" is pressed

I have an Observable collection SerialList of a class SerialItem containing a single string property Number, to which I am binding a DataGrid's ItemsSource. The purpose is for the user to see some ...
tombobadil's user avatar
0 votes
1 answer
295 views

Validation.ErrorEvent is not rised when element with error is removed

I have to show a list where each item will be validated. I am subscribed to Validation.ErrorEvent on a top level to monitor for children. When I remove item with validation error from list this event ...
Sinatr's user avatar
  • 21.9k
0 votes
1 answer
312 views

Disable button when validating WPF

I made a rule validation on a property. What I want is that when the condition is not satisfied the save button should be disabled. How can I do it? This is how it looks: image. The button is not ...
robert.laszlo's user avatar
0 votes
1 answer
138 views

Missing DataErrorInfoAdapter in latest MvvmValidation package

After updating the MvvmValidation NuGet package from version 2.0.2 to 3.1.0, I get the error: The type or namespace name 'DataErrorInfoAdapter' could not be found (are you missing a using directive ...
ˈvɔlə's user avatar
  • 10.2k
1 vote
1 answer
306 views

Update property in ViewModel also if there are Validation-Errors

In my application I have the following definition of a DataGridTemplateColumn: <DataGridTemplateColumn Header="Placeholder-Name" Width="*"> <DataGridTemplateColumn.CellTemplate> ...
Tomtom's user avatar
  • 9,374
1 vote
1 answer
655 views

Doesn't disable the button if the textbox invalid

I have the email text block with validation <TextBox x:Name="email" Style="{StaticResource emaliStyle}" Grid.Column="2" Grid.Row="2"> <TextBox.Text> &...
Steve's user avatar
  • 35
13 votes
2 answers
11k views

How to add validation to view model properties or how to implement INotifyDataErrorInfo

I have a data collection of type ObservableCollection (say instance as myClassTypes). After some user operation, this myClassTypes populated with values in ViewModel. In view, there is a TextBox where ...
Arvind Pandey's user avatar
1 vote
1 answer
1k views

How to disable button until good validation in wpf mvvm

How can I disable button until good textbox validation? I have done some stuff but I don't know how to hide button until good validation in the right way with using MVVM pattern. I am still learning ...
criser's user avatar
  • 67
0 votes
2 answers
90 views

Input Validation in TextBox

Don't want the error message to be displayed at start/as tab opens. Validation is implemented using IDataErrorInfo (to VM), an ErrorTemplate (XAML) is defined and able to get error message beside ...
User1312's user avatar
1 vote
2 answers
155 views

C# WPF MVVM column filtering use of textboxes

In an MVVM pattern, I have 16 different strings bound to 16 textboxes for filtering columns, each of which has propertychanged assigned at creation. The logic fails due the remaining fields still ...
Lowrater's user avatar
0 votes
1 answer
272 views

WPF MVVM Tabconrol highlight tab with validation error

I'm using WPF MVVM pattern. I have a TabControl with multiple tabs on it All these tabs are using the same viewmodel. All the validations are working properly and as you can see in the attachement Im ...
user3092984's user avatar
0 votes
1 answer
256 views

Get the TabItem Name or header if it has validation Error

I have the following TabConrol <telerik:RadTabControl Grid.Row="2" VerticalAlignment="Top" SelectedIndex="{Binding SelectedIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ...
user3092984's user avatar
2 votes
1 answer
3k views

How to make a field required, based on the value of another field

I have a ViewModel with some public properties that have data annotations, like this: [Required] public string PointOfContact { get; set; } Which works just fine. I've got all of the necessary ...
Robert Harvey's user avatar
0 votes
1 answer
1k views

Display all error messages at each textbox during validation using IDataErrorInfo

I have a little issue with displaying all validations according to one property (textbox). Now my validation works as follow: Textbox's borded is red at start and displaying ONLY ONE error message ...
Adrian Przemysław Drozdowski's user avatar
0 votes
1 answer
240 views

Validation at start of application and Refresh listview when validation executes

I am developing a very simple application (I am learning C# WPF MVVM :)). I encountered 2 problems with validation. Valdiation: When Textbox is empty validation should start. First problem is that, ...
Adrian Przemysław Drozdowski's user avatar
0 votes
1 answer
1k views

how to validation empty textbox when button click wpf?

I'm new in wpf and i want to make validation with error message on any empty text box user left when he click button to store data to database. I tried this in View Model. But its showing same message ...
San Dy's user avatar
  • 27
-3 votes
2 answers
2k views

Dynamic Validation In WPF Using MVVM?

How to do text box input validation in wpf MVVM structure?
Aftab Lala's user avatar
0 votes
0 answers
118 views

wpf DelegateCommand and ValidationRules

i have have the TimePicker and validation rules <controls:TimePicker Grid.Row="0" Grid.Column="1" Culture="Ru-ru" Margin="5,5,5,2.5"> <controls:TimePicker.SelectedTime> ...
mi4man's user avatar
  • 3
0 votes
1 answer
334 views

How do I bind ComboBox with WPF and get SelectedItem?

I am sorry I am asking question on stack over flow first time so might be some thing i done wrong. I have started learning WPF MVVM and I'm stuck. I have one parameter master table in a database, ...
shailesh vora's user avatar
1 vote
0 answers
162 views

WPF DataGrid validation - showing tooltip around in cell

I have a DataGrid which looks like that: <DataGrid ColumnWidth="45" CanUserAddRows="False" HeadersVisibility="None" ItemsSource="{Binding CorrectionMatrixA, Converter={StaticResource ...
user avatar
3 votes
0 answers
536 views

Validation MarkInvalid Textbox using MVVM

I have a textbox that has validation on it, in the validation checks to see if its isNullOrEmpty. The validation works but what I am having difficulty is if the user never selects the textbox and ...
KrystianB's user avatar
  • 502
2 votes
1 answer
517 views

WPF Handling converter errors and view model validation

I have an MVVM application with INotifyDataErrorInfo all set up and functioning. Currently I am able to validate all my properties and gate the user from progressing until all errors are handled. ...
Terrordoll's user avatar
1 vote
2 answers
500 views

Textbox blank out valid value after erroneous input - WPF

So, I have a simple view containing a Textbox and a Label. <TextBox x:Name="MyIntTextBox" Text="{Binding MyInt, UpdateSourceTrigger=LostFocus, Mode=TwoWay, StringFormat={}{D2}}"/> <...
Sabyasachi Mukherjee's user avatar
0 votes
1 answer
1k views

WPF Data Annotation Validation issue

I am mostly web developer and I am super new to WPF. I am trying to work on one of the WPF project. I have hard time validating a model using a Data Annotations and MVVM. Can someone please point me ...
Andy Johnson's user avatar
1 vote
2 answers
294 views

Validating UserControl's control by Window's ViewModel

Suppose, I have created custom LoginForm as an UserControl, which consists of TextBox and PasswordBox. TextBox has installed custom ErrorTemplate. Naturally, I would like to have this LoginForm as ...
user avatar
2 votes
2 answers
873 views

MVVM pattern: IDataErrorInfo validation doesn't work if we have wrapped model inside another model

The problem is that the red rectangle is not shown on the UI. I use Caliburn.Micro and this is is what I have in my View: <StackPanel Grid.Row="0"> <Label>Customer name:</Label&...
Navuhodonosor's user avatar
0 votes
1 answer
1k views

Using dataAnnonation regular expression validation attribute in Wpf Mvvm IdataErrorInfo

I'm newbie to wpf app development using mvvm. So please ignore if I am asking something out of the box. I have a model class where I am validating the data using data annotations. Here is the code ...
Amad Zafar's user avatar
1 vote
1 answer
143 views

WPF validation run-time generated forms

I'm creating a WPF application which generates a form based on a model to edit it. I use reflection to go through all properties of the model to create inputfields for the properties. The GenerateForm ...
Sebastiaan Hoedeman's user avatar
0 votes
0 answers
96 views

Validate other user control from another

I have one user control with a combobox (UC1) and I have another user control with one text box with two buttons (UC2). I put one instance of UC2 on MainWindow. And I need to put 5 instances of UC1 ...
scsfdev's user avatar
  • 355
2 votes
1 answer
3k views

Error handling WPF - MVVM

I've read many articles on how to validate data in WPF - MVVM, but have gotten even more confused than I started. What I'm trying to do is simply add a new row to my db. The validation checks if the ...
Dimitri's user avatar
  • 1,966

1
2 3 4 5