Comments (4)
Hello grizoood, thank you for your interest in Windows Community Toolkit!
I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible.. Other community members may also answer the question and provide feedback ๐
from dotnet.
Thanks for providing more details @grizoood, didn't see this initially when I responded to your discussion here.
Going to transfer this to the .NET Community Toolkit repo where the MVVM Toolkit lives. FYI @Sergio0694
from dotnet.
Hi @grizoood! Would you be able to provide us a minimal repro? That would help us a lot to investigate this. By that I mean the minimum possible amount of code that can reproduce the issue (eg. literally just a single control in XAML with just a line for a binding, and the smallest viewmodel you can get, with like a single property and the minimum amount of validation possible, no comments, no extra code, etc.). Additionally, does the issue only happen with that custom setter you have, or can you also repro with eg. a TextBlock
binding its text? Thanks! ๐
from dotnet.
Sorry for the late reply, I put the issue on hold.
Validation works if I add a null style to hide cell validation:
Validation.ErrorTemplate" Value="{x:Null}"
<DataGridTemplateColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
<Style.Resources>
<Style TargetType="{x:Type ContentPresenter}">
<Setter Property="Validation.ErrorTemplate" Value="{x:Null}"/>
</Style>
</Style.Resources>
</Style>
</DataGridTemplateColumn.CellStyle>
Before: I have 2 borders (DataGridCell and TextBox)
Aprรจs: I have 1 border (TextBox)
<DataGridTemplateColumn Header="Start DataGridTemplateColumn (TextBox)">
<DataGridTemplateColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
<Style.Resources>
<Style TargetType="{x:Type ContentPresenter}">
<Setter Property="Validation.ErrorTemplate" Value="{x:Null}"/>
</Style>
</Style.Resources>
</Style>
</DataGridTemplateColumn.CellStyle>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Start, UpdateSourceTrigger=PropertyChanged}" Margin="5">
<TextBox.Style>
<Style TargetType="TextBox">
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="true">
<Setter Property="ToolTip" Value="{Binding (Validation.Errors)/ErrorContent, RelativeSource={RelativeSource Self}}"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
I didn't have the problem with the DataGridTextColumn because I was directly modifying the cell style of the DataGridTextColumn but not for the DataGridTemplateColumn.
from dotnet.
Related Issues (20)
- Can't get FlowExceptionsToTaskScheduler to work for error handling (with TaskScheduler.UnobservedTaskException) HOT 2
- Add an option to [ObservableProperty] - generate a private setter HOT 2
- IconTintColorBehavior throws exception when navigation happens via Shell Tab and app/system theme is changed HOT 1
- Guard.IsNotNull doesn't prevent warning CA1062 on .NET Standard 2.0
- SpeechToText.ListenAsync reports twice HOT 1
- CommandParameters other than Strings are not acceptable for RelayCommands?
- ObserveableProperty and Nullable Can Generate Warnings
- RelayCommand attribute only works in .Net 6 and above?
- Generated code tries to assign to a read only `ObservableCollection` HOT 1
- Factor ObservableObject into separate assembly HOT 4
- Automatically determine dependent properties with [ObservableProperty] HOT 1
- Better support for notifying cascading calculated properties HOT 1
- ObservableProperty with NotifyCanExecuteChangedFor exception occurs
- Adding property using [ObservableProperty] breaks hot reload HOT 5
- ObservableProperty attribute with specific accessor HOT 1
- Typo in Guard.ThrowHelper.ThrowArgumentNullExceptionForIsNotNull
- Crash when command parameter is MS.Internal.NamedObject "DisconnectedItem"
- `PropertyChanged` triggered on empty string HOT 3
- Setting 'CanExecute' doesn't change the status of Button controls when they are bound to RelayCommand HOT 1
- Adding version 8.2.2 to existing Maui project breaks xaml file(s) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotnet.