How to autosize DataGridView in Visual Basic(Vb.Net)

Autosize DataGridView in Visual Basic

You may want to show the fields of your database in Visual basic Form then you will need to display it in Datagridview. You may display it in Datagrid view but 1 thing you will find difficult is that the size of the datagrid view. Sometimes we need to increase and sometimes we need to decrease but this can not be done manually everytime so you need to autosize it,
You can do in this way
Here DataGridview1 is the name of the datagrid view which you would like to autosize.
So this way the size of the datagridview changes as the data crosses the bound.


Information Sharing Copyright © 2011