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

Trigger to disable control when DatePicker is null

1 Answer 216 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Ariel Erlijman
Top achievements
Rank 1
Ariel Erlijman asked on 17 Aug 2010, 05:55 PM
I have a grid where the rows have a DatePicker and a DropDown. I want to disable the DropDown if the DatePicker is empty. I have this in my grid:

 

<telerik:GridViewDataColumn DataFormatString="d" Header="Termination" DataMemberBinding="{Binding TerminationDate}" >
<telerik:GridViewDataColumn.CellEditTemplate>
<DataTemplate>                                                        
<telerik:RadDatePicker x:Name="TerminationDate" SelectedDate="{Binding Path=TerminationDate, Mode=TwoWay}"/>
</DataTemplate>
</telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>
  
<telerik:GridViewComboBoxColumn                                                
x:Name="TerminationReasonType"
Header="Beneficiary Terminated"
ItemsSource="{Binding Path=ReferenceData.AllBeneficiaryTerminationReasonType}"
DisplayMemberPath="Description"
SelectedValueMemberPath="_BeneficiaryTerminationReasonTypeID.Id"
DataMemberBinding="{Binding TerminationReasonID,UpdateSourceTrigger=PropertyChanged}">

<!--
<
telerik:GridViewComboBoxColumn.Style>
<Style TargetType="telerik:GridViewComboBoxColumn">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=TerminationDate}" Value="{x:Null}">
<Setter Property="FrameworkElement.IsEnabled" Value="false"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</telerik:GridViewComboBoxColumn.Style>
-->                                            
</telerik:GridViewComboBoxColumn>

 

 

 

I have tried the commented code but did not work. I can not reach the TerminationDate element.
Ideas?
Thx

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 19 Aug 2010, 04:35 PM
Hello Ariel Erlijman,

The property "IsEnabled" comes from the Framework ContentElement, which GridViewColumns inherit in our WPF version of RadGridView. Unfortunately, it is not implemented in the internal logic of the Control.
However, you may find detailed information about disabling a whole column in our online documentation and an example in our demos.

Best wishes,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
DateTimePicker
Asked by
Ariel Erlijman
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or