---
title: "Remove a grid from window using WPF"  
description: "Remove a grid from window using WPF"  
author: "E E Cummings"  
published: 2013-10-14  
updated: 2013-10-14  
canonical: https://www.mindstick.com/forum/1672/remove-a-grid-from-window-using-wpf  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Remove a grid from window using WPF

I have a [Grid](https://www.mindstick.com/forum/369/how-can-i-add-a-column-name-to-my-grid) in my WPF [application](https://www.mindstick.com/articles/12824/calculator-application-in-android) :

```
<Grid Name="MainGrid">    <Grid.RowDefinitions>        <RowDefinition Height="70" Name="BarRowDef" />        <RowDefinition Height="*"/>    </Grid.RowDefinitions>    <Grid Name="BarGrid" Grid.Row="0" Height="70" VerticalAlignment="Top" Background="#FF802C2C">        <Button Content="History" Focusable="False" Width="100" Height="60" HorizontalAlignment="Left" VerticalAlignment="Center" Name="HistoryButton" Click="HistoryButton_Click"/>    </Grid>    <Grid Name="MiddleGrid" Grid.Row="1">        <Grid.ColumnDefinitions>            <ColumnDefinition Width="*"/>        </Grid.ColumnDefinitions>        <WebBrowser HorizontalAlignment="Stretch" Name="Browser" VerticalAlignment="Stretch" LoadCompleted="Finish_Load" Grid.Column="1"/>    </Grid></Grid>
```

And i want to the [browser](https://www.mindstick.com/blog/155254/which-is-the-best-internet-browser) will have [full](https://www.mindstick.com/articles/12893/experience-the-full-power-of-suitecrm) [screen](https://www.mindstick.com/forum/33644/loading-screen-during-ajax-call) option. So what i done is in the [event](https://www.mindstick.com/articles/167719/marquee-hire-benefits-of-event-lighting-hire-london) Of EnterFullscreen is called is :

BarRowDef.Height = new GridLength(0);

And what happen is that the Browser start from the top of the [page](https://www.mindstick.com/articles/13031/why-to-make-a-wikipedia-page) but in the bottom i have a white [space](https://www.mindstick.com/articles/12954/do-your-electrical-repair-in-your-own-space) in the [size](https://www.mindstick.com/forum/159799/how-can-you-manage-the-size-of-mdf-and-ldf-files) of BarGrid. Any idea what can be the [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic)?

## Replies

### Reply by Andrew Deniel

I am not sure what do you mean, EnterFullscreen event of what?

You can try this:

```
BarGrid.Visibility = Visibility.Hidden;
```

instead of:

```
BarRowDef.Height = new GridLength(0);
```


---

Original Source: https://www.mindstick.com/forum/1672/remove-a-grid-from-window-using-wpf

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
