Bind property of one child to property of another child of same parent

3 posts, 1 answers
  1. Shreya
    Shreya avatar
    18 posts
    Member since:
    Aug 2014

    Posted 21 Aug 2014 Link to this post

    Hi,
    I am facing an Issue with binding in RadGrid. Here is my XAML

     <telerik:GridViewDataColumn Width="Auto" DataMemberBinding="{Binding IsTermChange}"  Header="Change Term" x:Name="TermChange">
                        <telerik:GridViewDataColumn.CellTemplate>
                            <DataTemplate>
                                <CheckBox IsChecked="{Binding IsTermChanged, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
                            </DataTemplate>
                        </telerik:GridViewDataColumn.CellTemplate>
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn Width="Auto" DataMemberBinding="{Binding IsActive}"  Header="Change Mileage">
                        <telerik:GridViewDataColumn.CellTemplate>
                            <DataTemplate>
                                <CheckBox IsChecked="{Binding IsActive, Mode=TwoWay}"/>
                            </DataTemplate>
                        </telerik:GridViewDataColumn.CellTemplate>
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn Width="Auto" DataMemberBinding="{Binding IsActive}"  Header="Add Option">
                        <telerik:GridViewDataColumn.CellTemplate>
                            <DataTemplate>
                                <Grid>
                                    <CheckBox Name="optionCheckBox"/>
                                </Grid>
                            </DataTemplate>
                        </telerik:GridViewDataColumn.CellTemplate>
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn Width="Auto" DataMemberBinding="{Binding IsActive}"  Header="Add Maint.">
                        <telerik:GridViewDataColumn.CellTemplate>
                            <DataTemplate>
                                <CheckBox IsChecked="{Binding IsActive, Mode=TwoWay}"/>
                            </DataTemplate>
                        </telerik:GridViewDataColumn.CellTemplate>
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewDataColumn Width="Auto" DataMemberBinding="{Binding IsActive}"  Header="Remove Maint.">
                        <telerik:GridViewDataColumn.CellTemplate>
                            <DataTemplate>
                                <CheckBox IsChecked="{Binding IsActive, Mode=TwoWay}"/>
                            </DataTemplate>
                        </telerik:GridViewDataColumn.CellTemplate>
                    </telerik:GridViewDataColumn>
                    <telerik:GridViewColumn Header="Proposed Term" >
                        <telerik:GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <telerik:RadComboBox Width="80" HorizontalAlignment="Left" Margin="3,1,0,0" Text="{Binding Path=TermRequested, Mode=TwoWay,   UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" IsEditable="True" ItemsSource="{Binding AvailableTermsList}" StaysOpenOnEdit="True" />
                            </DataTemplate>
                        </telerik:GridViewColumn.CellTemplate>
                    </telerik:GridViewColumn>

    I want to bind the IsEnabled property of radcombobox (bold one) only when IsChecked property is true for checkbox(bold one). I am not abble to achieve that. Please help it is urgent.






  2. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 24 Aug 2014 Link to this post

    Hello,

    I would suggest you working with the bound data items instead. In your case you have bound the IsChecked property to the IsTermChanged property of the bound item.
    If you would like to configure RadComboBox be IsEnabled based on it, you can directly bind it the same way. 
    For example:
    <telerik:RadComboBox Width="80" HorizontalAlignment="Left" Margin="3,1,0,0" Text="{Binding Path=TermRequested, Mode=TwoWay,   UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" IsEditable="True" ItemsSource="{Binding AvailableTermsList}" StaysOpenOnEdit="True" IsEnabled="{Binding IsTermChanged}/>


    You can also consider using the IsReadOnlyBinding property of RadGridView. Please check our online documentation for more information on how it works.

    Regards,
    Didie
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Shreya
    Shreya avatar
    18 posts
    Member since:
    Aug 2014

    Posted 26 Aug 2014 in reply to Dimitrina Link to this post

    Thanks a ton for the reply !!! will surely try dat way !!!
Back to Top