tags:

views:

79

answers:

3

I am building an application that requires a Datagrid that can be hidden. I have tried wrapping it in an Expander but it isn't exactly ideal. Ideally what I would like is the ability to have the DataGrid "floating" outside the main window without affecting the other controls and just having a button to hide and show it when needed.

Is this at all possible?

Thanks for your time.

+1  A: 

You will have to put it on a form to make it float. The new form can be a child of the main form opened as non-modal.

A9S6
+1  A: 

You could put it in a Popup and change its IsOpen state to hide or show it. Though keep in mind that the Popup won't move around with the window.

RandomEngy
Yes, exactly what I was after! Thanks so much.
The_Lorax
A: 
<ToggleButton Name="ShowHideGrid" Content="Show/Hide Grid"/>
<Popup IsOpen="{Binding ElementName=ShowHideGrid, Path=IsChecked}">
    <!-- Grid goes here -->
</Popup>
Nir