Fixes spurious DataGrid data validation error #15716
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does the pull request do?
Usually it is not necessary to provide the target property when creating a
BindingExpression
because the property will be assigned when the binding expression is attached to the target inBindingExpressionBase.Attach
.This is however one case where
Attach
is not called: when the obsoletebinding.Initiate
method is called and then an observable is read from theInstancedBinding
without the binding actually being attached to the target object. In this case, prior to the binding refactor in #13970 the value produced by the observable was still converted to the target type. After #13970, because the target property (and hence the target type) is not yet set, the conversion is to the target type is no longer done.DataGrid
uses this obsolete method when editing cells, causing #15081. Ideally we'd fix that inDataGrid
but I'm not happy making this change so close to 11.1, so instead fix this use-case to behave as before.Fixed issues
Fixes #15081