DataGridTemplateColumn.CellEditingTemplate绑定在代码后面

时间:2014-12-09 20:52:00

标签: c#

我想绑定列值DataGridTemplateColumn但我无法绑定事物 ..这是我的代码

<DataGridTemplateColumn.CellEditingTemplate>
                                                        <DataTemplate>
                                                            <TextBox Text="{Binding x, Mode=TwoWay, StringFormat={}\{0:N2\}%}">

                                                                <TextBox.Style>
                                                                    <Style TargetType="TextBox">
                                                                        <Setter Property="Background">
                                                                            <Setter.Value>
                                                                                <MultiBinding Converter="{StaticResource v2b}" ConverterParameter="column header">
                                                                                    <Binding RelativeSource="{RelativeSource FindAncestor,AncestorType={x:Type Window}}"/>
                                                                                    <Binding Path="."/>
                                                                                </MultiBinding>
                                                                            </Setter.Value>
                                                                        </Setter>
                                                                    </Style>
                                                                </TextBox.Style>
                                                            </TextBox>
                                                        </DataTemplate>
                                                    </DataGridTemplateColumn.CellEditingTemplate>   

0 个答案:

没有答案