title: How to Add Check Box in Datagrid WPF c#
body: <p>Hi i want to add check box in datagrid view.i have writen test code but fails.
  What i am trying to do is Add a CheckBox in datagrid with the items i add into it
  with select all and select none option.</p>
  
  <p>I donot know how to do it so i need some help.I am confused with a thing that if we add then dynamically how would we track which checkbox was checked or un checked.</p>
  
  <p>I have current code </p>
  
  <pre><code>    public partial class MainWindow : Window
      {
          List&lt;checkedBoxIte&gt; item = new List&lt;checkedBoxIte&gt;();
          public MainWindow()
          {
              InitializeComponent();
              for (int i = 0; i &lt; 5; i++)
              {
                  checkedBoxIte ite = new checkedBoxIte();
                  ite.sr = i.ToString();
                  ite.ch = new CheckBox();
                  item.Add(ite);
              }
              dataGrid1.ItemsSource = item
          }
      }
      public class checkedBoxIte
      {
         public string sr {get;set;}
         public CheckBox ch { get; set; }
      }
  </code></pre>
  
  <p>but i know it is stupidest thing to add checkbox like this but it was just a try
  Above class contains two attributes later on it would have more but all will be strings</p>