Trigger to disable control when DatePicker is null

2 posts, 0 answers
  1. Ariel Erlijman
    Ariel Erlijman avatar
    5 posts
    Member since:
    Jun 2010

    Posted 17 Aug 2010 Link to this post

    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

     

     

     

     

     

  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 19 Aug 2010 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top