We help IT Professionals succeed at work.
Get Started

How to get GridView grid to resize on a windows form

brgdotnet
brgdotnet asked
on
122 Views
Last Modified: 2018-11-02
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

Panel1.Controls.Add(Me.dgvMyForm)
Form1.txt
Form1.Designer.txt
Form1.resx
WindowsApplication1.vbproj
Comment
Watch Question
Chief Technology Ninja
CERTIFIED EXPERT
Distinguished Expert 2020
Commented:
This problem has been solved!
Unlock 2 Answers and 16 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE