Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to dock datagridview to parent container but leave space for search fields?

  • I want to leave some space for search fields on the top of datagridview but also want to dock my datagridview to parent container, so when I open the application as maximize it should fit the screen.

below are the images to explain you better.

  • If I dock the datagridview to parent container

enter image description here

  • if I undock datagridview and add search fields on the top of it (Without running application).

enter image description here

  • if I open the datagridview form in maximize form it looks like this. I want to leave some space for search fields but dock the remaining datagridview to maximize window. (When I run the app).

enter image description here

like image 898
Patrick Avatar asked Oct 14 '25 18:10

Patrick


1 Answers

use two panels, one is Dock top and another Dock fill, place your grid in the second panel and make it also dock fill. You can apply dome padding for the grid by setting padding property in the second panel.

enter image description here

like image 90
Damith Avatar answered Oct 17 '25 10:10

Damith



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!