form size with datagridview



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.

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
Regards Robert.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question