I was wondering whether it is possible to remove the unused space ( the gray space ) of the DataGridView
control in C#. I have to make the DataGridView>
I use this code for and it works for my if you don't add a button column or image I take it from a site but I don't remember from where :
For Each row As DataGridViewRow In DataGridView1.Rows
If datagrid_limits > newHeight Then
newHeight =newHeight + 40
Else
Exit For
End If
Next
DataGridView1.Height = newHeight