I have a simple WPF form with a Grid declared on the form. This Grid has a bunch of rows:
Grid
Set the Row's content visibility to Visibility.Collapsed instead of Hidden. This will make the content stop taking up space, and the row will shrink appropriately.
Visibility.Collapsed