title: Getting whole row value if checkbox is checked in datagrid C#
body: <p>I'm trying to write a code for getting 3 values from textboxes if some of checkboxes in same row is checked.
  Anyone know an easy(or hard) way to do this?</p>
  
  <p>My datagrid looks like this: <img src="https://i.stack.imgur.com/tzvJG.jpg" alt="enter image description here"></p>
  
  <p>I have Load button that finds a file of specific type(XML.config) somewhere in file system, after that I'm calling a method that gets some strings from that file, find substrings of them and put them in 3 separated lists. Those values are in datagrid as Type, MapTo and Name.
  I accomplish this by putting all 3 lists in one ObservableCollection and after that I'm sending that ObservalableCollection to datagrid like this:</p>
  
  <pre><code>ObservableCollection&lt;Tuple&lt;string, string, string&gt;&gt; _obsCollection = new   ObservableCollection&lt;Tuple&lt;string, string, string&gt;&gt;();
  public ObservableCollection&lt;Tuple&lt;string, string, string&gt;&gt; MyObsCollection
  {
      get { return _obsCollection; }
  }
  tabela.ItemsSource = _obsCollection;
  </code></pre>
  
  <p>This is XAML code that shows binding:</p>
  
  <pre><code>&lt;DataGrid Grid.Column="0" AutoGenerateColumns="False" Height="206" HorizontalAlignment="Left" Margin="12,265,0,0" Name="tabela" VerticalAlignment="Top" Width="556" SelectionChanged="tabela_SelectionChanged" Grid.RowSpan="2" ItemsSource="Binding MyObsCollection"&gt;
              &lt;DataGrid.Columns&gt;
  
                  &lt;DataGridTextColumn Header="Type" Width="122" Binding="{Binding Item1}"/&gt;
                  &lt;DataGridTextColumn Header="MapTo" Width="122" Binding="{Binding Item2}"/&gt;
                  &lt;DataGridTextColumn Header="Name" Width="121" Binding="{Binding Item3}"/&gt;
  
                  &lt;DataGridTemplateColumn Header="Controller"&gt;
                      &lt;DataGridTemplateColumn.CellTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;CheckBox IsChecked="{Binding DataGridChecked}"/&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/DataGridTemplateColumn.CellTemplate&gt;
                  &lt;/DataGridTemplateColumn&gt;
  
                  &lt;DataGridTemplateColumn Header="Service"&gt;
                      &lt;DataGridTemplateColumn.CellTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;CheckBox IsChecked="{Binding DataGridChecked}"/&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/DataGridTemplateColumn.CellTemplate&gt;
                  &lt;/DataGridTemplateColumn&gt;
  
                  &lt;DataGridTemplateColumn Header="Injection"&gt;
                      &lt;DataGridTemplateColumn.CellTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;CheckBox IsChecked="{Binding DataGridChecked}"/&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/DataGridTemplateColumn.CellTemplate&gt;
                  &lt;/DataGridTemplateColumn&gt;
  
              &lt;/DataGrid.Columns&gt;
  
          &lt;/DataGrid&gt;
  </code></pre>
  
  <p>What I'm practically trying to is to accomplish looping thou all 3 columns containing checkboxes to see which of them are selected and if any of 3 in same row is selected then I need to send all 3 string values from that row to some variable. 
  Anyone can help me with this. For instance I don't know how to get isSelected property from checkbox in data grid.
  I was doing a lot of researching and all that I was able to find was examples for DataGridView, and almost nothing for DataGrid.</p>