title: Custom ItemsControl with grid layout
body: <p>i have my custom itemscontrol for displaying sudoku game grid. I want it to display its items to 9X9 grid. Each item has X and Y property and i want to bind to that property position in grid (Grid row and grid. column). Everything looks working except binding these grid.row and grid.column properties.. Code follows. It is not fault of binding because if i use hard values, nothing changes. Please help.:</p>
  
  <pre><code>&lt;ItemsControl  Margin="4" ItemsSource="{Binding Cells, Mode=OneWay}" x:Name="grid"&gt;
      &lt;ItemsControl.ItemTemplate&gt;
          &lt;DataTemplate&gt;
                  &lt;grid:GridCell Grid.Column="{Binding X}" Grid.Row="{Binding Y}"  /&gt;
          &lt;/DataTemplate&gt;
      &lt;/ItemsControl.ItemTemplate&gt;
      &lt;ItemsControl.ItemsPanel&gt;
          &lt;ItemsPanelTemplate&gt;
                  &lt;Grid IsItemsHost="True" Background="Pink"&gt;
                      &lt;Grid.RowDefinitions&gt;
                          &lt;RowDefinition /&gt;
                          &lt;RowDefinition /&gt;
                          &lt;RowDefinition /&gt;
                          &lt;RowDefinition Height="2" /&gt;
                          &lt;RowDefinition /&gt;
                          &lt;RowDefinition /&gt;
                          &lt;RowDefinition /&gt;
                          &lt;RowDefinition Height="2" /&gt;
                          &lt;RowDefinition /&gt;
                          &lt;RowDefinition /&gt;
                          &lt;RowDefinition /&gt;
                      &lt;/Grid.RowDefinitions&gt;
                      &lt;Grid.ColumnDefinitions&gt;
                          &lt;ColumnDefinition /&gt;
                          &lt;ColumnDefinition /&gt;
                          &lt;ColumnDefinition /&gt;
                          &lt;ColumnDefinition Width="2" /&gt;
                          &lt;ColumnDefinition /&gt;
                          &lt;ColumnDefinition /&gt;
                          &lt;ColumnDefinition /&gt;
                          &lt;ColumnDefinition Width="2" /&gt;
                          &lt;ColumnDefinition /&gt;
                          &lt;ColumnDefinition /&gt;
                          &lt;ColumnDefinition /&gt;
                      &lt;/Grid.ColumnDefinitions&gt;
              &lt;/Grid&gt;
          &lt;/ItemsPanelTemplate&gt;
      &lt;/ItemsControl.ItemsPanel&gt;
  &lt;/ItemsControl&gt;
  </code></pre>
  
  <p>Edit:
  Nothing changes if i use for example</p>
  
  <pre><code>&lt;ItemsControl.ItemTemplate&gt;
      &lt;DataTemplate&gt;
              &lt;grid:GridCell Grid.Column="2" Grid.Row="2"  /&gt;
      &lt;/DataTemplate&gt;
  &lt;/ItemsControl.ItemTemplate&gt;
  </code></pre>