Help with autosize of dataGridView

Posted on 2016-09-18
Last Modified: 2016-09-19

How do you adjust the height of  the DatagridView depending on the number of records using VB.NET?


Question by:vcharles
  • 2
LVL 62

Accepted Solution

Fernando Soto earned 500 total points
ID: 41804148
Hi Victor;

I believe you can use DataGridView.RowCount to show that many rows.
LVL 23

Expert Comment

by:Pawan Kumar
ID: 41804171
Put datagrid in a div or table and use height as 100%

Author Comment

ID: 41804207
Hi Fernando,

It works with DataGridView.RowCount * 25


Pawan Thanks for your comment.

LVL 62

Expert Comment

by:Fernando Soto
ID: 41804582
Not a problem Victor, glad to help.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now