Help with autosize of dataGridView

vcharles
vcharles used Ask the Experts™
on
Hi,

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

Thanks,

Victor
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Retired
Distinguished Expert 2017
Commented:
Hi Victor;

I believe you can use DataGridView.RowCount to show that many rows.
Pawan KumarDatabase Expert
Awarded 2016
Top Expert 2016

Commented:
Put datagrid in a div or table and use height as 100%

Author

Commented:
Hi Fernando,

It works with DataGridView.RowCount * 25

Thanks

Pawan Thanks for your comment.

Victor
Fernando SotoRetired
Distinguished Expert 2017

Commented:
Not a problem Victor, glad to help.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial