Spaces after the last line in the .NET DataGridView

I work with datagridview in C #, when a datagridview contains so many rows to fill in the size and show a vertical scroll bar, and I scroll down to the last row, there is a space with the row height.

Here is a screenshot:

Screenshot

Is there any way to avoid this?

+4
source share
7 answers

My first assumption was that you have a bottom line in which there is nothing. Try setting ShowFooter = "false" as a grid.

0
source

Grid sometimes has an extra line related to editing. For example, a DataGridView has an EditMode property. If you set a value for this to indicate that the view is not editable by the user, this may cause the line at the bottom to disappear.

0
source

try to install

AllowUserToAddRows

false

0
source

I have exactly the same problem and I found the following entry:

removing empty gray space in datagrid in c #

0
source

Your mesh color may be white. Please change it.

0
source
ScrollViewer.CanContentScroll="False" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" 

It worked for me.

0
source

I had this problem and tried to find the answer, but I could not. My colleague has a simple tip for me and a trick: you just resize your datagridview (height) as the last space (gray space) is the smallest as you can. It worked for me.

-1
source

Source: https://habr.com/ru/post/1340870/


All Articles