Free for PREMIUM members
Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium
' Get the number of rows in the grid and multiply it by the first row height. This assumes all rows are of the same height. You may want to add 1 more row to account for the header row.
DataGridView1.Height = DataGridView1.Rows.Count() * DataGridView1.Rows(0).Height
Open in new window
We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!