I am using the Telerik controls for silverlight, i am suing the RadGridView for data grid, i have tow columns in which has celltemplate and celledit template.
1st column:
<telerik:GridViewDataColumn Header="Input Control" >
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<TextBlock x:Name="txtInputControl" Text="{Binding ControlName}"></TextBlock>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
<telerik:GridViewDataColumn.CellEditTemplate>
<DataTemplate>
<ComboBox x:Name="cbxInputControl"
ItemsSource="{Binding ReportParamControlEx}" DisplayMemberPath="ControlName"
SelectedValuePath="ControlId"
SelectedValue="{Binding Path=ControlId, Mode=TwoWay, ValidatesOnNotifyDataErrors=True,NotifyOnValidationError=True}"
SelectedItem="{Binding SelectedInputControl, Mode=TwoWay}" SelectionChanged="cbxInputControl_SelectionChanged" />
</DataTemplate>
</telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>
2nd columns
<telerik:GridViewDataColumn Header="Data Package Name">
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock x:Name="txtDataPackageName" Text="{Binding DataPackageName,Mode=TwoWay,ValidatesOnNotifyDataErrors=True,NotifyOnValidationError=True }"></TextBlock>
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
<telerik:GridViewDataColumn.CellEditTemplate>
<DataTemplate>
<ComboBox x:Name="cbxDataPackageNames"
VerticalAlignment="Center"
ItemsSource="{Binding DataPackages}"
SelectedValue="{Binding DataPackageName, Mode=TwoWay,ValidatesOnNotifyDataErrors=True,NotifyOnValidationError=True}"
SelectedValuePath="DataPackageName"
DisplayMemberPath="DataPackageName"
SelectedItem="{Binding SelectedDataPackage, Mode=TwoWay}"
IsEnabled="{Binding Path=Text, ElementName=txtInputControl, Converter={StaticResource converter}}"/>
</DataTemplate>
</telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>
When user selects the item from the 1st column combobox i need to disable the 2nd column, for this i am suign the IsEnabled property but it is not working...is it doesn't work in Edittemplate ???
More infor:
<local:SelectionToEnableConverter x:Key="converter" />
public class SelectionToEnableConverter : IValueConverter
{
public SelectionToEnableConverter()
{
}
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value == null)
return false;
TextBlock tb = (TextBlock)value;
if (tb.Text == String.Empty || tb.Text == "TextBox")
return false;
return true;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}