1
votes

When I enter values in the last row of my DataGridView, it moves up, revealing a soft grey underbelly. I don't want the rows to move, and I don't know why they do.

To see what the grid looks like at first, and then how it looks when entering data into the bottom row, see http://warbler.posterous.com/the-slippery-row

There's a panel behind the DataGridView, but it's not grey; its backcolor is "Moccasin," so it's not the panel that's being seen (the background color of the DataGridView is Gainsboro, but the cells I populate it with are white).

1
I guess that it is a new row that will be used as a row through which you can create a new record. As far as I know, that is kind of the default behaviour (look at for example SQL Server Management Studio, editing rows). But on the other hand, I could be completely wrong.Styxxy
No, it's not a row - I can click on it until the cows come home without actually entering it. And: it doesn't happen on my coworker's Windows 7 machine; only on XP. Unfortunately, most of our users have XP.B. Clay Shannon
The grey is probably the BackgroundColor of your DataGridView, also see here: stackoverflow.com/questions/2122985/… .Styxxy
Yes, it is the background color, I know that. I'm going to try Hans Passant's custom class from that link...B. Clay Shannon
Passant's code works; I'm going to say it again: I wish that cat would write a C# book, or more specifically one on Windows 8 development (don't know if he's interested in it or not).B. Clay Shannon

1 Answers

0
votes

Passant's idea/code works:

1) Create a new class, copy-and-paste his code from here into it:

removing the empty gray space in datagrid in c#

2) Build the project via F6

3) Drag the custom DGV to your form, and voila! problem solved