wpf - Workaround for binding expression list on binding group being empty -


in wpf 4 binding expression list on binding group, passed validationrule's validate method, empty.

it same whether autogeneratecolumns true or false, whether datagridboundcolumns explicitly has been added datagrid.

in wpf 3.5 sp1 using datagrid toolkit binding expression list filled excepted binding expressions (1 each column in data grid)

i consider bug , has posted on microsoft connect site: https://connect.microsoft.com/wpf/feedback/details/642815/bindingexpressions-on-bindinggroup-passed-to-validationrule-in-datagrid-rowvalidationrules-is-empty

but have workaround can correct binding expression within validationrule?

in order support "proposed values" not committed target of two-way binding until validation succeeds, wpf 4.0 datagrid redesigned take advantage of the new bindinggroup.sharesproposedvalues feature of wpf 4.0. because of change, no longer necessary use two-way bindings in binding group of display templates.

you can use bindinggroup.trygetvalue retrieve proposed values other columns instead of using old method worked datagrid wpf toolkit.

in other words, new datagrid fixes undesirable feature of old datagrid , result things work differently (i.e. missing bindings design) can still need do.

the explanation in microsoft's own words in microsoft connect link:

and here blog describes bindinggroup.sharesproposedvalues in way:


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -