Windows Develop Bookmark and Share   
 index > Windows Forms General > Making a datgridview fit a tabpage?
 

Making a datgridview fit a tabpage?

Hi,
I'm filling a datagridview with data from two databases and this datagridview is being displayed on a tabpage. The only problem is the default size of the datagridview only displays two columns (of about 9), the user would have to use the scroll bar to see the rest.

Is there a handy way to do make the datagrids size automatically change to fit the tabpage, or at least change to display all the columns?
I can see how to change the size of the rows and columns, but not the size of the datgridview itself...
I'm using C#.


Kybalion  Wednesday, August 22, 2007 8:49 AM

You could always dock the datagridview in the tabpage

Ken Tucker  Wednesday, August 22, 2007 9:21 AM

You could always dock the datagridview in the tabpage

Ken Tucker  Wednesday, August 22, 2007 9:21 AM
Thanks Ken, that worked great

I used: dataGridView1.Dock = DockStyle.Fill;
Kybalion  Wednesday, August 22, 2007 9:27 AM

You can use google to search for other answers

Custom Search

More Threads

• Combobox value disappears
• Problem moving control from one Parent control to another
• ComboBox
• How to perform this...
• propogate an event up?
• How to handle child control's positioning in a custom stack panel during design?
• Splitter control
• Forms Opacity Property with VS 2005 C#
• How to implement printing in custom user control
• Dropdown of possible paths