Click here to Skip to main content
16,019,043 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,

I have a grid whose IsEnabled property is set to FALSE. And this grid is having many child controls inside it (label, textboxes, checkboxes etc). I need to enable only the checkboxes while IsEnabled property of grid is set to FALSE. Is it possible to do this?

What I have tried:

<Grid Grid.Row="1" Margin="1 2 2 2" IsEnabled="{Binding EnableEditMode,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
                     <Grid.ColumnDefinitions>
                         <ColumnDefinition Width="50*" MinWidth="375" />
                         <ColumnDefinition  Width="40*"  />
                         <ColumnDefinition  Width="10*"  />
                     </Grid.ColumnDefinitions>
                     <Grid.RowDefinitions>
                         <RowDefinition Height="50*" />
                         <RowDefinition Height="50*"/>
                         <RowDefinition Height="50*"/>
                         <RowDefinition Height="50*"/>
                         <RowDefinition Height="50*"/>
                         <RowDefinition Height="50*"/>
                         <RowDefinition Height="50*"/>
                         <RowDefinition Height="50*"/>
                         <RowDefinition Height="50*"/>
                         <RowDefinition Height="50*"/>
                         <RowDefinition Height="50*"/>
                     </Grid.RowDefinitions>
                     <Border BorderBrush="LightGray" BorderThickness="1" Grid.ColumnSpan="2" Grid.Row="0" >
                         <Label Grid.Column="0" Grid.Row="0" Content="{x:Static resourceDictionary:Resources.TT_LastGeneralOrder}"
                            Style="{StaticResource LabelStyle}"  />
                     </Border>
                     <Border BorderBrush="LightGray" BorderThickness="1" Grid.ColumnSpan="2" Grid.Row="1" >
                         <Label Grid.Column="0" Grid.Row="1" Content="{x:Static resourceDictionary:Resources.TT_LastBulletinOrder}"
                            Style="{StaticResource LabelStyle}"  />
                     </Border>
                     <Border BorderBrush="LightGray" BorderThickness="1" Grid.ColumnSpan="2" Grid.Row="2" >
                         <Label Grid.Column="0" Grid.Row="2" Content="{x:Static resourceDictionary:Resources.TT_LastGeneralNotice}"
                            Style="{StaticResource LabelStyle}"  />
                     </Border>
                     <Border BorderBrush="LightGray" BorderThickness="1" Grid.ColumnSpan="2" Grid.Row="3" >
                         <Label Grid.Column="0" Grid.Row="3" Content="{x:Static resourceDictionary:Resources.CAnd39inEffect}"
                            Style="{StaticResource LabelStyle}"  />
                     </Border>
                     <Border BorderBrush="LightGray" BorderThickness="1" Grid.ColumnSpan="2" Grid.Row="4" >
                         <Label Grid.Column="0" Grid.Row="4" Content="{x:Static resourceDictionary:Resources.TT_NewFormM}"
                            Style="{StaticResource LabelStyle}"  />
                     </Border>
                     <Border BorderBrush="LightGray" BorderThickness="1" Grid.ColumnSpan="2" Grid.Row="5" >
                         <Label Grid.Column="0" Grid.Row="5" Content="{x:Static resourceDictionary:Resources.TT_FormMInEffect}"
                            Style="{StaticResource LabelStyle}"  />
                     </Border>
                     <Border BorderBrush="LightGray" BorderThickness="1" Grid.ColumnSpan="2" Grid.Row="6" >
                         <Label Grid.Column="0" Grid.Row="6" Content="{x:Static resourceDictionary:Resources.TT_NextPlateOrder}"
                            Style="{StaticResource LabelStyle}"  />
                     </Border>
                     <Border BorderBrush="LightGray" BorderThickness="1" Grid.ColumnSpan="2" Grid.Row="7" >
                         <Label Grid.Column="0" Grid.Row="7" Content="{x:Static resourceDictionary:Resources.TT_PlateOrderInEffect}"
                            Style="{StaticResource LabelStyle}"  />
                     </Border>
                     <Border BorderBrush="LightGray" BorderThickness="1" Grid.ColumnSpan="2" Grid.Row="8" >
                         <Label Grid.Column="0" Grid.Row="8" Content="{x:Static resourceDictionary:Resources.TT_LastOperationsNotice}"
                            Style="{StaticResource LabelStyle}"  />
                     </Border>
                     <Border BorderBrush="LightGray" BorderThickness="1" Grid.ColumnSpan="2" Grid.Row="9" >
                         <Label Grid.Column="0" Grid.Row="9" Content="{x:Static resourceDictionary:Resources.TT_PSNoticeinEffect}"
                            Style="{StaticResource LabelStyle}"  />
                     </Border>
                     <Border BorderBrush="LightGray" BorderThickness="1" Grid.ColumnSpan="2" Grid.Row="10" >
                         <StackPanel Orientation="Horizontal">
                             <Label Grid.Column="0" Content="{x:Static resourceDictionary:Resources.TT_RTCNoticeInEffect}"
                            Style="{StaticResource LabelStyle}"  />
                             <CheckBox x:Name="chkRTC" Margin="10" IsChecked="{Binding RTCCheckboxChecked,Mode=TwoWay}"/>
                         </StackPanel>
                     </Border>
                     <telerik:RadWatermarkTextBox Grid.Row="0"  Grid.Column="1"  CurrentText="{Binding LastGeneralOrder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     WatermarkContent="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40">

                     </telerik:RadWatermarkTextBox>
                     <CheckBox x:Name="ChkLastGeneralOrder"  Grid.Row="0"  Grid.Column="2"
                               IsChecked="{Binding Path=ReviewLastGeneralOrder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                               IsEnabled="{Binding Path=EnableReviewCheckControl,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                               DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorLevel=2,
                                                              AncestorType={x:Type UserControl}}, Path=DataContext}">
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type Grid}}}" CommandParameter="{Binding}" />
                             </i:EventTrigger>
                             <i:EventTrigger EventName="Unchecked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type Grid}}}" CommandParameter="{Binding}"/>
                             </i:EventTrigger>
                         </i:Interaction.Triggers>
                     </CheckBox>


                     <!--<xctk:WatermarkTextBox Grid.Row="0"  Grid.Column="1"  Text="{Binding LastGeneralOrder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     Watermark="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40" />-->
                     <telerik:RadWatermarkTextBox Grid.Row="1"  Grid.Column="1"
                                     CurrentText="{Binding LastBulletinOrder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     WatermarkContent="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40">
                     </telerik:RadWatermarkTextBox>
                     <CheckBox x:Name="ChkLastBulletinOrder"  Grid.Row="1"  Grid.Column="2"
                         IsChecked="{Binding Path=ReviewLastBulletinOrder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                         IsEnabled="{Binding Path=EnableReviewCheckControl,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                               DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorLevel=1,
                                                              AncestorType={x:Type Grid}}, Path=DataContext}">

                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type Grid}}}" CommandParameter="{Binding}" />
                             </i:EventTrigger>
                             <i:EventTrigger EventName="Unchecked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type Grid}}}" CommandParameter="{Binding}"/>
                             </i:EventTrigger>
                         </i:Interaction.Triggers>
                     </CheckBox>
                     <!--<xctk:WatermarkTextBox Grid.Row="1"  Grid.Column="1"
                                     Text="{Binding LastBulletinOrder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     Watermark="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40" />-->
                     <telerik:RadWatermarkTextBox Grid.Row="2"  Grid.Column="1"
                                     CurrentText="{Binding LastGeneralNotice,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     WatermarkContent="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40" >
                     </telerik:RadWatermarkTextBox>
                     <CheckBox x:Name="ChkLastGeneralNotice"  Grid.Row="2"  Grid.Column="2"
                               IsChecked="{Binding Path=ReviewLastGeneralNotice,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                               IsEnabled="{Binding Path=EnableReviewCheckControl,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                              >
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}" />
                             </i:EventTrigger>
                             <i:EventTrigger EventName="Unchecked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}"/>
                             </i:EventTrigger>
                         </i:Interaction.Triggers>

                     </CheckBox>
                     <!--<xctk:WatermarkTextBox Grid.Row="2"  Grid.Column="1"
                                     Text="{Binding LastGeneralNotice,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     Watermark="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40" />-->
                     <telerik:RadWatermarkTextBox Grid.Row="3"  Grid.Column="1"
                                     CurrentText="{Binding CAnd39InEffect,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     WatermarkContent="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40">
                     </telerik:RadWatermarkTextBox>
                     <CheckBox x:Name="ChkCAnd39InEffect"  Grid.Row="3"  Grid.Column="2"
                               IsChecked="{Binding Path=ReviewCAnd39InEffect,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                               IsEnabled="{Binding Path=EnableReviewCheckControl,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                              >
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}" />
                             </i:EventTrigger>
                             <i:EventTrigger EventName="Unchecked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}"/>
                             </i:EventTrigger>
                         </i:Interaction.Triggers>

                     </CheckBox>
                     <!--<xctk:WatermarkTextBox Grid.Row="3"  Grid.Column="1"
                                     Text="{Binding CAnd39InEffect,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     Watermark="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40" />-->
                     <telerik:RadWatermarkTextBox Grid.Row="4"  Grid.Column="1"
                                     CurrentText="{Binding NextFormM,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     WatermarkContent="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40" >
                     </telerik:RadWatermarkTextBox>
                     <CheckBox x:Name="ChkNextFormM"  Grid.Row="4"  Grid.Column="2"
                               IsChecked="{Binding Path=ReviewNextFormM,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                               IsEnabled="{Binding Path=EnableReviewCheckControl,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                            >
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}" />
                             </i:EventTrigger>
                             <i:EventTrigger EventName="Unchecked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}"/>
                             </i:EventTrigger>
                         </i:Interaction.Triggers>

                     </CheckBox>
                     <!--<xctk:WatermarkTextBox Grid.Row="4"  Grid.Column="1"
                                     Text="{Binding NextFormM,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     Watermark="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40" />-->
                     <telerik:RadWatermarkTextBox Grid.Row="5"  Grid.Column="1"
                                     CurrentText="{Binding FormMInEffect,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     WatermarkContent="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40" >
                     </telerik:RadWatermarkTextBox>
                     <CheckBox x:Name="ChkFormMInEffect"  Grid.Row="5"  Grid.Column="2"
                               IsChecked="{Binding Path=ReviewFormMInEffect,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                               IsEnabled="{Binding Path=EnableReviewCheckControl,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                              >
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}" />
                             </i:EventTrigger>
                             <i:EventTrigger EventName="Unchecked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}"/>
                             </i:EventTrigger>
                         </i:Interaction.Triggers>

                     </CheckBox>
                     <!--<xctk:WatermarkTextBox Grid.Row="5"  Grid.Column="1"
                                     Text="{Binding FormMInEffect,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     Watermark="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40" />-->
                     <telerik:RadWatermarkTextBox  Grid.Row="6"  Grid.Column="1"
                                     CurrentText="{Binding NextPlateOrder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     WatermarkContent="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40" >
                     </telerik:RadWatermarkTextBox>
                     <CheckBox x:Name="ChkNextPlateOrder"  Grid.Row="6"  Grid.Column="2"
                               IsChecked="{Binding Path=ReviewNextPlateOrder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                               IsEnabled="{Binding Path=EnableReviewCheckControl,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                              >
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}" />
                             </i:EventTrigger>
                             <i:EventTrigger EventName="Unchecked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}"/>
                             </i:EventTrigger>
                         </i:Interaction.Triggers>

                     </CheckBox>
                     <!--<xctk:WatermarkTextBox Grid.Row="6"  Grid.Column="1"
                                     Text="{Binding NextPlateOrder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     Watermark="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40" />-->
                     <telerik:RadWatermarkTextBox  Grid.Row="7"  Grid.Column="1"
                                     CurrentText="{Binding PlateOrderInEffect,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     WatermarkContent="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40"></telerik:RadWatermarkTextBox>

                     <CheckBox x:Name="ChkPlateOrderInEffect"  Grid.Row="7"  Grid.Column="2"
                               IsChecked="{Binding Path=ReviewNextPlateOrderInEffect,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                               IsEnabled="{Binding Path=EnableReviewCheckControl,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                              >
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}" />
                             </i:EventTrigger>
                             <i:EventTrigger EventName="Unchecked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}"/>
                             </i:EventTrigger>
                         </i:Interaction.Triggers>

                     </CheckBox>
                     <!--<xctk:WatermarkTextBox Grid.Row="7"  Grid.Column="1"
                                     Text="{Binding PlateOrderInEffect,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     Watermark="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40" />-->
                     <telerik:RadWatermarkTextBox Grid.Row="8"  Grid.Column="1"
                                     CurrentText="{Binding LastOperationsNotice,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     WatermarkContent="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40" ></telerik:RadWatermarkTextBox>

                     <CheckBox x:Name="ChkLastOperationsNotice"  Grid.Row="8"  Grid.Column="2"
                               IsChecked="{Binding Path=ReviewLastOperationsNotice,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                               IsEnabled="{Binding Path=EnableReviewCheckControl,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                              >
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}" />
                             </i:EventTrigger>
                             <i:EventTrigger EventName="Unchecked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}"/>
                             </i:EventTrigger>
                         </i:Interaction.Triggers>

                     </CheckBox>
                     <!--<xctk:WatermarkTextBox Grid.Row="8"  Grid.Column="1"
                                     Text="{Binding LastOperationsNotice,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     Watermark="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40" />-->
                     <telerik:RadWatermarkTextBox Grid.Row="9"  Grid.Column="1"
                                     CurrentText="{Binding PsNoticeInEffect,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     WatermarkContent="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40" ></telerik:RadWatermarkTextBox>

                     <CheckBox x:Name="ChkPsNoticeInEffect"  Grid.Row="9"  Grid.Column="2"
                               IsChecked="{Binding Path=ReviewPsNoticeInEffect,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                               IsEnabled="{Binding Path=EnableReviewCheckControl,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                               >
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}" />
                             </i:EventTrigger>
                             <i:EventTrigger EventName="Unchecked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}"/>
                             </i:EventTrigger>
                         </i:Interaction.Triggers>

                     </CheckBox>
                     <!--<xctk:WatermarkTextBox Grid.Row="9"  Grid.Column="1"
                                     Text="{Binding PsNoticeInEffect,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     Watermark="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40" />-->
                     <telerik:RadWatermarkTextBox  Grid.Row="10"  Grid.Column="1" IsEnabled="{Binding RTCCheckboxChecked,Mode=TwoWay}"
                                     CurrentText="{Binding RtcNoticeInEffect,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     WatermarkContent="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="9,3,1,7" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40" ></telerik:RadWatermarkTextBox>

                     <CheckBox x:Name="ChkRtcNoticeInEffect"  Grid.Row="10"  Grid.Column="2"
                               IsChecked="{Binding Path=ReviewRtcNoticeInEffect,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                               IsEnabled="{Binding Path=EnableReviewCheckControl,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                             >
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}" />
                             </i:EventTrigger>
                             <i:EventTrigger EventName="Unchecked">
                                 <i:InvokeCommandAction Command="{Binding Path=DataContext.ReviewCheckedCommand,RelativeSource={RelativeSource FindAncestor,
                    AncestorType={x:Type UserControl}}}" CommandParameter="{Binding}"/>
                             </i:EventTrigger>
                         </i:Interaction.Triggers>

                     </CheckBox>
                     <!--<xctk:WatermarkTextBox Grid.Row="10"  Grid.Column="1" IsEnabled="{Binding RTCCheckboxChecked,Mode=TwoWay}"
                                     Text="{Binding RtcNoticeInEffect,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     Watermark="{x:Static resourceDictionary:Resources.EnterText}"
                                     BorderBrush="LightGray" Margin="5" VerticalAlignment="Stretch"
                                     HorizontalAlignment="Stretch" FontSize="16" FontFamily="Arial"
                                     Foreground="#525252" AcceptsReturn="True" TextWrapping="Wrap"
                                     SpellCheck.IsEnabled="True" Language="en-US"
                                     VerticalScrollBarVisibility="Auto" MaxLength="250" MinHeight="40" MaxHeight="40" />-->

                     <!--<TextBox Grid.Row="0" MaxLength="100" Text="{Binding LastGeneralOrder,Mode=TwoWay}" Grid.Column="1"  Margin="5"
                              Style="{StaticResource RoundCornerTextBoxStyle}" />
         <TextBox Grid.Row="1" MaxLength="100" Text="{Binding LastBulletinOrder,Mode=TwoWay}" Grid.Column="1"  Margin="5"
                              Style="{StaticResource RoundCornerTextBoxStyle}" />
         <TextBox Grid.Row="2" MaxLength="100" Text="{Binding LastGeneralNotice,Mode=TwoWay}" Grid.Column="1"  Margin="5"
                              Style="{StaticResource RoundCornerTextBoxStyle}" />
       <TextBox Grid.Row="3" MaxLength="100" Text="{Binding CAnd39InEffect,Mode=TwoWay}" Grid.Column="1"  Margin="5"
                              Style="{StaticResource RoundCornerTextBoxStyle}" />
         <TextBox Grid.Row="4" MaxLength="100" Text="{Binding NextFormM,Mode=TwoWay}" Grid.Column="1"  Margin="5"
                              Style="{StaticResource RoundCornerTextBoxStyle}" />
         <TextBox Grid.Row="5" MaxLength="100" Text="{Binding FormMInEffect,Mode=TwoWay}" Grid.Column="1"  Margin="5"
                              Style="{StaticResource RoundCornerTextBoxStyle}" />
         <TextBox Grid.Row="6" MaxLength="100" Text="{Binding NextPlateOrder,Mode=TwoWay}" Grid.Column="1"  Margin="5"
                              Style="{StaticResource RoundCornerTextBoxStyle}" />
         <TextBox Grid.Row="7" MaxLength="100"  Text="{Binding PlateOrderInEffect,Mode=TwoWay}" Grid.Column="1"  Margin="5"
                              Style="{StaticResource RoundCornerTextBoxStyle}" />
         <TextBox Grid.Row="8" MaxLength="100" Text="{Binding LastOperationsNotice,Mode=TwoWay}" Grid.Column="1"  Margin="5"
                              Style="{StaticResource RoundCornerTextBoxStyle}" />
         <TextBox Grid.Row="9" MaxLength="100" Text="{Binding PsNoticeInEffect,Mode=TwoWay}" Grid.Column="1"  Margin="5"
                              Style="{StaticResource RoundCornerTextBoxStyle}" />-->

                 </Grid>
Posted
Updated 4-Apr-18 4:55am
Comments
Richard Deeming 17-Oct-17 14:14pm    
It doesn't seem to be possible. Setting IsEnabled="False" on the parent automatically disables its children, even if you set IsEnabled="True" on them.

I suspect you'll need to disable the specific child controls that you want disabled, rather then disabling the entire grid.
TABiSH777 23-Oct-17 9:30am    
you can't
as the parent itself is disabled, allowing the child to be inaccessible even if they are individually enabled.
Hence Solution here is as Richard said "you'll need to disable the specific child controls that you want disabled"

Have a 2nd Grid that overlays the first Grid (this is just so that you can get the sizing right), and that Grid only has the CheckBoxes any other controls required for sizing can be set to hidden as opposed to collapsed. Then just can disable the whole background grid, and leave the foreground grid with the checkboxes enabled.
 
Share this answer
 
Based on the complexity of your layout, Clifford's suggestion would be far from optimal and not recommended.

You could create a custom Grid control by inheriting the standard Grid control, add a new custom IsEnabledEx Dependency Property and manually handle the enabling/disabling of child controls as suggested above by Richard and Tabish777...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900