LuckyLuke82 LuckyLuke82 - 3 months ago 14 Question

Title above DataGridView

How should I design my

to have a title of DB table above it, and to dock both (title and
) into a container? I tried with
, but they both dock in the left corner, and one covers another.


I suggest you use a TableLayoutPanel control with 1 column and 2 rows.

Dock(Top) the control you desire to work as title - Label for instance - or whatever you wish in first row, then set the row to autosize

Dock(Fill) the DataGridView in second row and set the row to percent (100%)

Set margins of both controls to (0;0;0;0) if you consider the gaps unsdesirable.

Place the TableLayoutPanel in your form the way you'd do with the single DataGridView