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
425
AllowEdit and AllowAddNew with Binding
posted

i try to bind my "IsReadOnly"-Property to FieldSettings.AllowEdit and FieldLayoutSettings.AllowAddNew Property, with my own "OppositeNullableBoolConverter".

 

 <igDP:XamDataGrid xmlns:igDP="http://infragistics.com/DataPresenter"
                                    DataContext="{Binding Aktivitaet}"
                                    DataSource="{Binding DataContext.rsVerteiler, RelativeSource={RelativeSource Self}}"
                                    Height="127" Margin="161,326.723,19,0" Name="grd_Verteiler"
                                    VerticalAlignment="Top">
                    <igDP:XamDataGrid .FieldLayoutSettings>
                        <igDP:FieldLayoutSettings AllowAddNew="{Binding Path=DataContext.IsReadOnly,
                                                                Mode=OneWay,
                                                                RelativeSource={RelativeSource AncestorType={x:Type igDP:XamDataGrid}},
                                                                Converter={StaticResource localBoolToOppositeNullableBoolConverter}}" />
                    </igDP:XamDataGrid .FieldLayoutSettings>
                    <igDP:XamDataGrid .FieldSettings>
                        <igDP:FieldSettings AllowEdit="{Binding Path=DataContext.IsReadOnly,
                                                                Mode=OneWay,
                                                                RelativeSource={RelativeSource AncestorType={x:Type igDP:XamDataGrid}},
                                                                Converter={StaticResource localBoolToOppositeNullableBoolConverter}}" />
                    </igDP:XamDataGrid .FieldSettings>
                </igDP:XamDataGrid >

 

alternative binding:

<igDP:XamDataGrid xmlns:igDP="http://infragistics.com/DataPresenter"
                                    DataSource="{Binding Aktivitaet.rsVerteiler}"
                                    Height="127" Margin="161,326.723,19,0" Name="grd_Verteiler"
                                    VerticalAlignment="Top">
                    <igDP:XamDataGrid.FieldLayoutSettings>
                        <igDP:FieldLayoutSettings AllowAddNew="{Binding Path=Aktivitaet.IsReadOnly,
                                                                Mode=OneWay,
                                                                Converter={StaticResource localBoolToOppositeNullableBoolConverter}}" />
                    </igDP:XamDataGrid.FieldLayoutSettings>
                    <igDP:XamDataGrid.FieldSettings>
                        <igDP:FieldSettings AllowEdit="{Binding Path=Aktivitaet.IsReadOnly,
                                                                Mode=OneWay,
                                                                Converter={StaticResource localBoolToOppositeNullableBoolConverter}}" />
                    </igDP:XamDataGrid.FieldSettings>
                </igDP:XamDataGrid>

 

the binding to DataSource works fine but by the binding at AllowAddNew and AllowEdit i get this binding error at runtime:

Cannot find governing FrameworkElement or FrameworkContentElement for target element

what am I doing wrong?

thank you.

 

 

Parents Reply Children
No Data