This is a migrated thread and some comments may be shown as answers.

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

2 Answers 275 Views
Window
This is a migrated thread and some comments may be shown as answers.
Shreya
Top achievements
Rank 1
Shreya asked on 21 Aug 2014, 11:27 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 24 Aug 2014, 10:16 AM
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.
 
0
Shreya
Top achievements
Rank 1
answered on 26 Aug 2014, 01:36 PM
Thanks a ton for the reply !!! will surely try dat way !!!
Tags
Window
Asked by
Shreya
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Shreya
Top achievements
Rank 1
Share this question
or