title: make data grid visible on click
body: <p>I have this data grid  where I am placing all my buttons</p>
  
  <pre><code>&lt;Grid x:Name="ButtonGrid" HorizontalAlignment="Left" Margin="0,90,0,4" Width="186"&gt;
     &lt;Button x:Name="B1" Content="B1" Height="18" Margin="73,0,59,16" VerticalAlignment="Bottom" Click="B1"/&gt;
     &lt;Button x:Name="B2" Content="B2" Height="18" Margin="0,0,-2,16" VerticalAlignment="Bottom" Click="B2_Click" HorizontalAlignment="Right" Width="57"/&gt;
   &lt;/Grid&gt;
  </code></pre>
  
  <p>I have the grid collapased on start. But when a button {testGrid} is clicked, I want the grid to ne visible.
  Here is my code</p>
  
  <pre><code>   namespace project.Test
      {
          public partial class MainPage : UserControl
          {
              public MainPage()
              {
                  InitializeComponent();
              }
  </code></pre>
  
  <p><strong>EDUTED</strong>  </p>
  
  <pre><code>        private void testGrid_Click(object sender, System.Windows.RoutedEventArgs e)
          {
               FrameworkElement ButtonGrid = (sender as FrameworkElement).FindName("ButtonGrid") as FrameworkElement;
  
      if ( ButtonGrid.Visibility == System.Windows.Visibility.Collapsed)
          ButtonGrid.Visibility = System.Windows.Visibility.Visible;
      else
          ButtonGrid.Visibility = System.Windows.Visibility.Collapsed;
  
          }
  
  
  
      }
  }
  </code></pre>