0

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.

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
Simeon Wislang
  • 461
  • 2
  • 9
  • 21

3 Answers3

1

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
  • 6,575
  • 10
  • 50
  • 82
1

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
  • 14,931
  • 5
  • 70
  • 113
0
<ToggleButton Name="ShowHideGrid" Content="Show/Hide Grid"/>
<Popup IsOpen="{Binding ElementName=ShowHideGrid, Path=IsChecked}">
    <!-- Grid goes here -->
</Popup>
Nir
  • 29,306
  • 10
  • 67
  • 103