Dan Cundy
Dan Cundy

Reputation: 2859

Stop DataGridView from flowing under panel?

Question

How can I stop my datagridview from moving underneath the panel when the window is resized?

Example

enter image description here

What I have tried? And what I would like.

What I would like is if the datagridview docked to the bottom of the panel.

Upvotes: 0

Views: 168

Answers (1)

rory.ap
rory.ap

Reputation: 35318

You have to modify the Anchor property on your controls. Based on what you've provided, the DataGridView control is probably anchored Bottom, Right, and you should anchor it Top, Left to match what the panel control's anchor is.

Also, if you do want the grid to be anchored to the bottom, right, you can set the MinimumSize property of your form accordingly so that it can never be resized such that the controls "collide".

It's not possible without third-party controls to dock one control to another control.

Upvotes: 1

Related Questions