Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need help with Columns in a DataGridView control.

Status
Not open for further replies.

RotorTorque

Programmer
Joined
Apr 29, 2007
Messages
100
Location
US
Hi all,
I have a VB2005 application in which I use a DataGridView cotrol. The DataGridView control's size is static, but the number of columns in the DataGridView varies depending on the query i use to populate the control. There are times when there are too few columns to take up the entire Width of the DataGridView. When this happens is there code I could write that will extend the rightmost column up to the edge of the DataGridView?

Thanks is advance,
RotorTorque :-)
 
I would set minimum widths on my columns, then use AutoSizeColumnsMode = Fill to make sure they fill the control.

Hope this helps,

Alex

[small]----signature below----[/small]
With all due respect, Don Bot, I don't think we should rely on an accident happening. Let's kill him ourselves.

Ignorance of certain subjects is a great part of wisdom
 
Thank you AlexCuse for the quick reply. I will try your suggestion.

RotorTorque :-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top