title: WPF Binding on multiple criterias
body: <p>In my MVVM, in view I have a DataGrid  where I want to enable the row elements based on 2 criteria.  DataGrid has checkbox in 1 col (that is bound to IsRowChecked property) and a header checkbox in another col. I want to enable the row element if 
  1) IsRowChecked is true AND
  2) Header checkbox is selected.</p>
  
  <p>Is this multiple criteria setting possible ?</p>
  
  <p>XAML </p>
  
  <pre><code>&lt;DataGrid ItemsSource="{Binding SiList, Mode=TwoWay}" Name="dgvSiSelection"&gt;
        &lt;DataGrid.Columns&gt;                  
            &lt;DataGridCheckBoxColumn Binding="{Binding IsRowChecked, Mode=TwoWay}"/&gt;  
            &lt;DataGridTextColumn Header="" Binding="{Binding Header}" MinWidth="108" IsReadOnly="True"/&gt;
            &lt;DataGridTemplateColumn&gt;
                &lt;DataGridTemplateColumn.Header&gt;
                      &lt;Grid&gt;
                          &lt;Grid.ColumnDefinitions&gt;
                                &lt;ColumnDefinition /&gt;
                          &lt;/Grid.ColumnDefinitions&gt;
                          &lt;TextBlock Text="Number of Chemicals" Grid.Column="0"  /&gt;
                      &lt;/Grid&gt;                                        
                 &lt;/DataGridTemplateColumn.Header&gt;
                 &lt;DataGridTemplateColumn.CellTemplate&gt;
                       &lt;DataTemplate&gt;
                            &lt;TextBlock Text="{Binding Path=NumberOfCases}" /&gt;
                       &lt;/DataTemplate&gt;
                       &lt;/DataGridTemplateColumn.CellTemplate&gt;
                       &lt;DataGridTemplateColumn.CellEditingTemplate&gt;
                            &lt;DataTemplate&gt;
                                &lt;TextBox IsEnabled="{Binding Path=IsRowChecked}" Text="{Binding Path=NumberOfCases, Mode=TwoWay}" /&gt;
                           &lt;/DataTemplate&gt;
                       &lt;/DataGridTemplateColumn.CellEditingTemplate&gt;
                   &lt;/DataGridTemplateColumn&gt;
  
  
                   &lt;!-- Value1  chkValue11--&gt;
                   &lt;DataGridTemplateColumn&gt;
                       &lt;DataGridTemplateColumn.Header&gt;
                            &lt;Grid&gt;
                                &lt;Grid.ColumnDefinitions&gt;
                                      &lt;ColumnDefinition/&gt;
                                      &lt;ColumnDefinition/&gt;
                                &lt;/Grid.ColumnDefinitions&gt;
                                &lt;TextBlock Grid.Column="1" Text="Value1" IsEnabled="{Binding ElementName=chkValue11, Path=IsChecked}" /&gt;
                                &lt;CheckBox Name="chkValue11"  Grid.Column="0" Width="16" /&gt;
                            &lt;/Grid&gt;
                       &lt;/DataGridTemplateColumn.Header&gt;
                       &lt;DataGridTemplateColumn.CellTemplate&gt;
                            &lt;DataTemplate&gt;
                                  &lt;TextBlock Text="{Binding Path=Value1}" /&gt;
                            &lt;/DataTemplate&gt;
                       &lt;/DataGridTemplateColumn.CellTemplate&gt;
                       &lt;DataGridTemplateColumn.CellEditingTemplate&gt;
                              &lt;DataTemplate&gt;
                                   &lt;TextBox IsEnabled="{Binding ElementName=chkValue11, Path=IsChecked}" Text="{Binding Path=Value1, Mode=TwoWay}" /&gt;
                              &lt;/DataTemplate&gt;
                        &lt;/DataGridTemplateColumn.CellEditingTemplate&gt;
                    &lt;/DataGridTemplateColumn&gt;
  
                    &lt;!-- Value2  chkValue12--&gt;
                    &lt;DataGridTemplateColumn&gt;
                        &lt;DataGridTemplateColumn.Header&gt;
                            &lt;Grid&gt;
                                &lt;Grid.ColumnDefinitions&gt;
                                     &lt;ColumnDefinition/&gt;
                                     &lt;ColumnDefinition/&gt;
                                &lt;/Grid.ColumnDefinitions&gt;
                                &lt;TextBlock Grid.Column="1" Text="Value2" IsEnabled="{Binding ElementName=chkValue12, Path=IsChecked}" /&gt;
                                &lt;CheckBox Name="chkValue12"  Grid.Column="0" Width="16" /&gt;
                            &lt;/Grid&gt;
                      &lt;/DataGridTemplateColumn.Header&gt;
                      &lt;DataGridTemplateColumn.CellTemplate&gt;
                           &lt;DataTemplate&gt;
                                  &lt;TextBlock Text="{Binding Path=Value2}" /&gt;
                           &lt;/DataTemplate&gt;
                      &lt;/DataGridTemplateColumn.CellTemplate&gt;
                      &lt;DataGridTemplateColumn.CellEditingTemplate&gt;
                            &lt;DataTemplate&gt;
                                 &lt;TextBox IsEnabled="{Binding ElementName=chkValue12, Path=IsChecked}" Text="{Binding Path=Value2, Mode=TwoWay}" /&gt;
                            &lt;/DataTemplate&gt;
                      &lt;/DataGridTemplateColumn.CellEditingTemplate&gt;
                  &lt;/DataGridTemplateColumn&gt;
  
         &lt;/DataGrid.Columns&gt;
     &lt;/DataGrid&gt;
  </code></pre>
  
  <p>"Number of Chemicals" col need only single criteria binding which I could do. Value1 &amp; Value2 needs 2 criteria i.e. of IsRowChecked and header checkbox selected. I could do with single, but can't get a way to implement 2 criteria's in these bindings.</p>
  
  <p>How can I achieve this sort of binding ??? </p>
  
  <p>Any help is highly appreciated.</p>
  
  <p>Thanks</p>