troubleshooting Question

How to get GridView grid to resize on a windows form

Avatar of brgdotnet
brgdotnetFlag for United States of America asked on
Visual Basic.NET
16 Comments2 Solutions125 ViewsLast Modified:
I have a windows form with a GridView in it. When the form is resized, I want the Grid to resize as well . I tried setting the Anchor attribute for the GridView object but still the GridView will not resize. Note that the GridView is added to a panel control.

Can someone tell me how I can get the Grid to resize when the form resizes?

dgvMyForm As DataGridView

dgvMyForm .Anchor = AnchorStyles.Left Or AnchorStyles.Right Or AnchorStyles.Top Or AnchorStyles.Bottom

Panel1 As System.Windows.Forms.SplitContainer

Chinmay Patel
Chief Technology Ninja
Join our community to see this answer!
Unlock 2 Answers and 16 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 16 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros