Datagridview problem, several new blank rows get created

limi

Member
Joined
Apr 3, 2007
Messages
8
Programming Experience
Beginner
Can anyone plz help on these?
Very often, I've found that while typing in some value in datagridviews, as I click into the next new blank row, immediately several (normally 3) new blank rows get created. How can I prevent this?

And, some of my programs have datagridviews in which the user doesn't have to type in any value. Values get entered into these grids in the following way: the user has to double click in some of the columns. This invokes some forms which displays some values in list/grid, etc. Clicking "Ok" on this invoked forms straightaway takes values from this invoked forms and places them in the datagridview's row. This works fine. The problem is that in a blank datagridview, i.e. a grid with a single blank row, values do come into the row but as soon as the row losts focus, the row appears blank. Hence, data can't be saved. What to do? (If even a single keystroke is made, however, in any cell of the particular row, immediately a new blank row gets created just below this row and the problem is gone).
 
Well, let's re-frame my second problem. In an empty datagridview, as soon as I type into the single blank row, immediately a new blank row is created and added beneath it.
Now, suppose instead of typing into the row, some values automatically (through program) fill up the cells of the aforesaid row, what has to be done so that a new blank row is created below it? (DataGridView.Rows.Add or DataGridView.RowCount = DataGridView.RowCount + 1 can't be done as it's a data-bound grid).
 
Back
Top