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
710
UnboundField does not trigger OnRecordUpdated
posted

I have embedded a custom control in UnboundField and turned TwoWay binding, the result is that OnRecordUpdated is not triggered after value change, if I change UnboundField to Field then event is triggered.

Can anyone help on this ? :)how to make UnboundField trigger this event?

the whole source code is in attachment but the ~interesting part is as follows:

    <Window.Resources>
        <Style x:Key="MyTestTextCellPresenter"
TargetType
="{x:Type igDP:CellValuePresenter}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate
TargetType
="{x:Type igDP:CellValuePresenter}">
                        <Grid>
                            <TextBox
Text
="{Binding RelativeSource={RelativeSource TemplatedParent},
Path
=Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>

    <Grid>
        <igDP:XamDataGrid x:Name="itemGrid"
DataSource="{Binding Source={x:Static MyTest:MainWindow.People}}" 
                          Margin="0,0,0,0" 
                          Background="Gray" 
                          Opacity="50"
                          InitializeRecord="OnInitializeRecord"
                          RecordUpdated="OnRecordUpdated"
                          >
            <igDP:XamDataGrid.FieldLayouts>
                <igDP:FieldLayout>
                    <igDP:FieldLayout.Fields>
                        <igDP:Field Name="Age"/>
                        <igDP:UnboundField Name="FamilyName"
                                           Label="MyTest">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings 
CellValuePresenterStyle="{StaticResource MyTestTextCellPresenter}"
                                    />
                            </igDP:Field.Settings>
                        </igDP:UnboundField>
                        <igDP:Field Name="Name"/>
                    </igDP:FieldLayout.Fields>
                </igDP:FieldLayout>
            </igDP:XamDataGrid.FieldLayouts>
        </igDP:XamDataGrid>
    </Grid>
GridTests.zip
  • 138253
    Offline posted

    Hello,

     

    It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking through your post and I created a sample project for you using your code. Basically I changed the UnboundField properties. I removed its Name and add BindingPath set to FamilyName property of your underlying data in order to bind it to that Field, because It had the same name as an existing Field and this cause confusion in the Bindings.

     

    Feel free to write me if you have further questions.

    xamDataGridUnboundFieldUpdate.zip