0

2 simple question about resizing in WPF (images included):
1) When I make my mainwindow user-resizable it seems that if the user would want to reduce the size - the whole window with its' components wouldn't become smaller, some of them will just disappear. 2) The same goes for DataGrid columns - if I make them resizable - the user may drag the 1st. & last cols out of the DataGrid.

Is there a way to make the window adjust to its' size, and to limit columns from going over the grid bounds? Thanks!
1 https://s23.postimg.org/6ihg27dfv/image.png (the DataGrid gets cut from the right)
2 https://s23.postimg.org/4t8cu4xqj/image.png (I dragged a column outside)

Yair V.
  • 109
  • 1
  • 10

1 Answers1

0

You could either put your MainWindow content in a ViewBox (where the content would scale to the size of the Window) or create a DataTemplateSelector that is aware of the size and applies a different template based upon the available layout (responsive design).

Eric
  • 1,737
  • 1
  • 13
  • 17