ValidationBinding - DataGrid

Jan 5, 2009 at 5:11 PM
Edited Jan 5, 2009 at 5:13 PM
Hello,

I'm trying to use the Standalone ValidationApplicationBlock ValidationBinding by Daniel Cazzulino, to bind data to a DataGridTemplateColumn of the WPF Toolkit DataGrid CTP. The ValidationBinding works fine if not used within a DataGrid, and a normal Binding works fine in the DataGrid. But using the ValidationBinding within a DataGrid displays just empty cells, not complaining about any binding errors.

I found that in ValidationBinding.cs, around line 49

  expression = binding.ProvideValue(serviceProvider) as BindingExpression;

expression is null, meaning no binding takes place. Any idea how to fix this?

Thanks a lot.


some xaml:

                    <grid:DataGridTextColumn Binding="{v:ValidationBinding Path=ID}"  Header="ID"/>

or
                    <grid:DataGridTemplateColumn Header="ID">
                        <grid:DataGridTemplateColumn.CellEditingTemplate>
                            <DataTemplate>
                                <TextBox Text="{v:ValidationBinding Path=ID}" Margin="0" Padding="0" BorderThickness="0"/>
                            </DataTemplate>
                        </grid:DataGridTemplateColumn.CellEditingTemplate>
                        <grid:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{v:ValidationBinding Path=ID}"/>
                            </DataTemplate>
                        </grid:DataGridTemplateColumn.CellTemplate>
                    </grid:DataGridTemplateColumn>




Jan 6, 2009 at 9:08 AM
Found something. Try:

http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/a9ead3d5-a4e4-4f9c-b507-b7a7d530c6a9/