title: WPF binding datagrid checkbox
body: <p>I'm newbie to WPF programming...</p>
  
  <p>I want to populate DataGrid with checkbox for each unique application from a given list, where technician can select application(s) for each device of its choice, and once he/she clicks on 'submit' button...tool would create a  csv for the device which would later used for application mapping...</p>
  
  <p>here is my xaml.</p>
  
  <pre><code>$Appname = 'App1', 'App2', 'App3'
  [xml]$xaml= @"
  &lt;Window 
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          Title="Application Deployment Staging" Height="672.607" Width="905.517"&gt;
     &lt;Grid&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="368*"/&gt;
              &lt;ColumnDefinition Width="425*"/&gt;
          &lt;/Grid.ColumnDefinitions&gt;
          &lt;TextBox Name="TXTDeviceName" HorizontalAlignment="Left" Height="22" Margin="81,45,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="194"/&gt;
          &lt;GroupBox Name="Grpbx01" Header="Enter Device Name" HorizontalAlignment="Left" Height="70" Margin="33,16,0,0" VerticalAlignment="Top" Width="310" FontWeight="Bold"/&gt;
          &lt;GroupBox Name="Grpbx02" Header="Available Applications" HorizontalAlignment="Left" Height="456" Margin="34,100,0,0" VerticalAlignment="Top" Width="810" Grid.ColumnSpan="2"&gt;
              &lt;DataGrid Name="Datagrd1" HorizontalAlignment="Left" Height="412" Margin="9,16,0,0" VerticalAlignment="Top" Width="776"&gt;
                  &lt;DataGrid.Columns&gt;
  
  
  
                   &lt;/DataGrid.Columns&gt;
               &lt;/DataGrid&gt;
          &lt;/GroupBox&gt;
          &lt;Button Name="btn01" Content="Submit" Grid.Column="1" HorizontalAlignment="Left" Margin="226.4,578,0,0" VerticalAlignment="Top" Width="90" Height="27" FontWeight="Bold"&gt;
              &lt;Button.Background&gt;
                  &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt;
                      &lt;GradientStop Color="#FF77CAAB" Offset="0.771"/&gt;
                      &lt;GradientStop Color="#FFFAFAFA" Offset="0.003"/&gt;
                  &lt;/LinearGradientBrush&gt;
              &lt;/Button.Background&gt;
          &lt;/Button&gt;
          &lt;Button Name="btn02" Content="Cancel" Grid.Column="1" HorizontalAlignment="Left" Margin="337.4,576,0,0" VerticalAlignment="Top" Width="90" Height="27" FontWeight="Bold"&gt;
              &lt;Button.Background&gt;
                  &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt;
                      &lt;GradientStop Color="#FF98B1A8" Offset="0.771"/&gt;
                      &lt;GradientStop Color="#FFFAFAFA" Offset="0.003"/&gt;
                  &lt;/LinearGradientBrush&gt;
              &lt;/Button.Background&gt;
          &lt;/Button&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  "@
  
  # Add assemblie
  Add-Type -AssemblyName PresentationFramework, PresentationCore, WindowsBase, System.DirectoryServices, system.Drawing, System.Windows.Forms, WindowsFormsIntegration
  
  $reader=(New-Object System.Xml.XmlNodeReader $xaml)
  $Form=[Windows.Markup.XamlReader]::Load( $reader )
  $xaml.SelectNodes("//*[@Name]") | %{ Set-Variable -Name "$($_.Name)" -Value $Form.FindName($_.Name) -ErrorAction Stop }
  
  $Form.ShowDialog() | Out-Null
  </code></pre>