Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
Problem binding textblock control inside FieldSettings.CellValuePresenterStyle
posted

Hi,

I am trying out the Infragistics WPF controls (version 9.1) and am facing a little problem. In my XamDataGrid, I want to use a Field that holds a TextBlock and that TextBlock's Text property needs to be bound to a property which is being used as the DataSource of the XamDataGrid. Here's the code-

<igDP:XamDataGrid x:Name="xdgAuditGrid" Theme="Office2k7Black" BorderBrush="Silver" BorderThickness="6"
                          Padding="10">
            <igDP:XamDataGrid.FieldLayouts>
                <igDP:FieldLayout>
                    <igDP:FieldLayout.Settings>
                        <igDP:FieldLayoutSettings AutoGenerateFields="False" AllowAddNew="False"
                                                  AllowDelete="False"/>
                    </igDP:FieldLayout.Settings>
                    <igDP:FieldLayout.Fields>
                        <igDP:Field x:Name="dgcRevisionStamp" Name="RevisionStamp" Label="Occured On" />
                        <igDP:Field x:Name="dgcAction" Name="Actions" Label="Action" Converter="{StaticResource ActionConverter}"/>
                        <igDP:Field x:Name="dgcUserName" Name="UserName" Label="User Name" />
                        <igDP:Field x:Name="dgcTableName" Name="TableName" Label="Table Name" />
                        <igDP:UnboundField x:Name="dgcInitData" Label="Initial Data">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings>
                                    <igDP:FieldSettings.CellValuePresenterStyle>
                                        <Style TargetType="{x:Type igDP:CellValuePresenter}">
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                                                        <TextBlock x:Name="txbOldData"
                                                                   Text="{Binding OldData}"
                                                                   Loaded="TxbOldData_Loaded"
                                                                   ToolTipService.ShowDuration="20000"/>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </igDP:FieldSettings.CellValuePresenterStyle>
                                </igDP:FieldSettings>
                            </igDP:Field.Settings>
                        </igDP:UnboundField>                             

                    </igDP:FieldLayout.Fields>
                </igDP:FieldLayout>
            </igDP:XamDataGrid.FieldLayouts>
            <igDP:XamDataGrid.FieldSettings>
                <igDP:FieldSettings AllowEdit="False"/>
            </igDP:XamDataGrid.FieldSettings>
        </igDP:XamDataGrid>

The code marked in bold, should bind the text property of the control "txbOldData". But after the datagrid is loaded, all other properties are bound, except for the "Initial Data" column.

It'd be of great help if you could show me what I am doing wrong here?

Thanks a bunch!!

 

Parents Reply Children
No Data