This question is locked. New answers and comments are not allowed.
Hi,
We have scenarion where the textboxes column will be enabled based on the status of radio button in the Header.
The radio buttons in the Column headers are bind to the ViewModel bool properties
The setter of the Property that is bind to the radio button is not being called when the value is changed.
Here is how my XAM looks like
SourceSearchData is bind to Observable collection.
What I want to do is if the IsReduceByPercentEnable radio button is selected then enable all the textboxes in that column and disable all the textboxes in IsReduceByUnitsEnable column.
<telerik:RadGridView x:Name="SaveView" ItemsSource="{Binding SourceSearchData}">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Area}" Width="200" IsFilterable="True">
<telerik:GridViewDataColumn.Header>
<TextBlock Text="Area" />
</telerik:GridViewDataColumn.Header>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Subsidiary}" Width="200" IsFilterable="True">
<telerik:GridViewDataColumn.Header>
<TextBlock Text="Subsidary"/>
</telerik:GridViewDataColumn.Header>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Width="150">
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox IsEnabled="{Binding IsPercentEnable, Mode=TwoWay}" Text="{Binding Percent}"></TextBox>
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
<telerik:GridViewDataColumn.Header>
<RadioButton IsChecked="{Binding IsReduceByPercentEnable, Mode=TwoWay}" GroupName="source" Content="By Percentage"/>
</telerik:GridViewDataColumn.Header>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Width="150">
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox IsEnabled="{Binding IsUnitsEnable, Mode=TwoWay}" Text="{Binding Unit}" Margin="10,0,10,0" ></TextBox>
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
<telerik:GridViewDataColumn.Header>
<RadioButton IsChecked="{Binding IsReduceByUnitsEnable, Mode=TwoWay}" GroupName="source" Content="By Units"/>
</telerik:GridViewDataColumn.Header>
</telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
I am using Silverlight 4.0
We have scenarion where the textboxes column will be enabled based on the status of radio button in the Header.
The radio buttons in the Column headers are bind to the ViewModel bool properties
The setter of the Property that is bind to the radio button is not being called when the value is changed.
Here is how my XAM looks like
SourceSearchData is bind to Observable collection.
What I want to do is if the IsReduceByPercentEnable radio button is selected then enable all the textboxes in that column and disable all the textboxes in IsReduceByUnitsEnable column.
<telerik:RadGridView x:Name="SaveView" ItemsSource="{Binding SourceSearchData}">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Area}" Width="200" IsFilterable="True">
<telerik:GridViewDataColumn.Header>
<TextBlock Text="Area" />
</telerik:GridViewDataColumn.Header>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Subsidiary}" Width="200" IsFilterable="True">
<telerik:GridViewDataColumn.Header>
<TextBlock Text="Subsidary"/>
</telerik:GridViewDataColumn.Header>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Width="150">
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox IsEnabled="{Binding IsPercentEnable, Mode=TwoWay}" Text="{Binding Percent}"></TextBox>
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
<telerik:GridViewDataColumn.Header>
<RadioButton IsChecked="{Binding IsReduceByPercentEnable, Mode=TwoWay}" GroupName="source" Content="By Percentage"/>
</telerik:GridViewDataColumn.Header>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Width="150">
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox IsEnabled="{Binding IsUnitsEnable, Mode=TwoWay}" Text="{Binding Unit}" Margin="10,0,10,0" ></TextBox>
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
<telerik:GridViewDataColumn.Header>
<RadioButton IsChecked="{Binding IsReduceByUnitsEnable, Mode=TwoWay}" GroupName="source" Content="By Units"/>
</telerik:GridViewDataColumn.Header>
</telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
I am using Silverlight 4.0