I have a form that contains dataGridView, whose coloumn are set to
dgrv1.Width =dgrv1.Columns.GetColumnsWidth(DataGridViewElementStates.Visible)+20;
I want to make the form to automaticaly follow the width of dataGridView…
Also, on maximized, I would like it to grow in height only.
Any sugestions?
Well, you have got a Width value. Set both the MaximumSize and MinimuSize properties of the Form to that value. Maybe with a little margin in between.
Leave the Max/Min Height properties on
0for default.Additional:
this gives me a Form that can only be 200 width, but the default ‘0’ for height seems not to work.