form size with datagridview

  • Thread starter Thread starter RobcPettit
  • Start date Start date
R

RobcPettit

Hi, on a form i have a splitcontair. In panel1 I have a list box. In
panel2 I have a datagridview. I add data using dataset and the column
number is always 10, but the row can be any number. Id like to know if
its possible, when the known number of rows/columns are added if I can
then snap the form to the datagridview size hieght, and width to
include the listbox. I can do this manually but would be neet to do in
the program.
Regards Robert
 
I don't know about "snapping the form to fit the dgv", but you can do the
opposite. Set the dgv's Dock property to DockStyle.Fill.

Otherwise, you have to figure out the size of your controls and set the size
of the form around it.

RobinS.
GioldMail, Inc.
 
Thankyou for your reply, Ive tried the fill method, but did not work.
Im now looping through the grid to get the size then resize the form
accordingly.
Regards Robert.
 
Back
Top