1

I have in my WPF a UniformGrid

<UniformGrid Height="144" HorizontalAlignment="Left" Margin="0,136,0,0" VerticalAlignment="Top" Width="213" MaxHeight="144" MaxWidth="213" MinHeight="144" MinWidth="213" x:Name="PATH_DataGrid" Columns="7" Rows="6">
</UniformGrid>

and I will add some autogeneretet Buttons over C# cod to it

Button b = new Button();
            b.Content = "22";
            b.Width = 100;
            b.Height = 100;

Ho can I add the button to the UniformGrid??

        PATH_DataGrid`???

THX for you help

Phil
  • 2,396
  • 2
  • 18
  • 15

1 Answers1

3
PATH_DataGrid.Children.Add(b)

That will add the button to the panel.

Bas
  • 26,772
  • 8
  • 53
  • 86