Reputation: 117
I have a windows forms application written in VB.NET (I'm comfortable taking suggestions in C# too) and I have two DataGridViews aligned vertically, so one above the other. I would like to be able to maximise the window and have the DataGridViews expand with the window so it looks roughly the same but bigger.
I have tried using the docking and anchoring controls and haven't found a way to do it without overlapping or leaving giant empty spaces which it should be expanding into.
Thanks
Upvotes: 0
Views: 801
Reputation: 13286
You can dock the first grid to the top and the second to fill, however the fill docking must be executed before the top docking (you can arrange that in the document outline tool window). This solution will leave the first grid always in the same height. You can also handle the form Resize event and calculate the position and size of the grids yourself.
Upvotes: 2