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

IsEnabled property for control in <telerik:GridViewDataColumn.CellEditTemplate>

1 Answer 77 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kartheek
Top achievements
Rank 1
Kartheek asked on 21 Dec 2010, 09:25 PM
Hi,

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();

 

}

}



1 Answer, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 22 Dec 2010, 03:08 PM
Hi Kartheek,

 

From the code snippet you provided I suppose that you have some issues with RadComboBox inside GridViewDataColumn's CellEditTemplate. If that is the case I would suggest you to use the sample from following forum thread.

If you need any further assistance please let me know.

Kind regards,
Vanya Pavlova
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
GridView
Asked by
Kartheek
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Share this question
or