title: How to set the style programmatically
body: <p>I have the following style but i need to make it programmatically:</p>
  
  <pre><code>&lt;xcdg:DataGridControl MinHeight="300" 
                        Name="listViewUnallocated" 
                        ItemsSource="{Binding Source={StaticResource
                                           cvs_unallocatedTerminals}}"
                        AllowDrop="True" 
                        Drop="Grid_Drop" 
                        MouseMove="Grid_MouseMove" 
                        KeyUp="listViewUnallocated_KeyUp"
                        MouseDoubleClick="gridUnallocated_MouseDoubleClick"
                        ReadOnly="True"
                        DockPanel.Dock="Top"&gt;
      &lt;xcdg:DataGridControl.Resources&gt;
          &lt;Style TargetType="{x:Type xcdg:DataRow}" x:Name="selectedStyleTrigger"&gt;
              &lt;Style.Triggers&gt;
                  &lt;DataTrigger Binding="{Binding TerminalId}" Value="72948028"&gt;
                      &lt;Setter Property="Background" Value="Red" /&gt;
                  &lt;/DataTrigger&gt;
              &lt;/Style.Triggers&gt;
          &lt;/Style&gt;
      &lt;/xcdg:DataGridControl.Resources&gt;
  </code></pre>