Linda, thanks for the reply and workaround, that will do the trick.
Cheers,
Stu
Hi, we tried the trick, but it works only if you press the "escape"
button.
If you try to go to a new row, then back to the first one and again to
the new added row (just switch between them), you'll get the same error
again (thus without pressing any key on the keyboard).
We tried to solve the problem, but couldn't find a way out yet. If
anybody has an idea....
Thanks, bye.
Luke
Stuart Carnie ha scritto:
> Linda, thanks for the reply and workaround, that will do the trick.
>
[quoted text clipped - 63 lines]
> >
> > This posting is provided "AS IS" with no warranties, and confers no rights.
semprini.luca@gmail.com - 12 Aug 2006 12:38 GMT
After some test I've found this "basic" solution, on the DataGridView
CellClick event check in the current row is a new row, and in case put
on che current cell a Space key and then a Backspace key. No more
trouble you will find.
I haven't my code here because I'm at home now, not at work, if someone
want see it I will paste here an example...
Note: to send "space" and "backspace" keys use SendKeys.Send("....");
function
bye, Luke
> Hi, we tried the trick, but it works only if you press the "escape"
> button.
[quoted text clipped - 77 lines]
> > >
> > > This posting is provided "AS IS" with no warranties, and confers no rights.
luca semprini - 17 Oct 2006 09:30 GMT
Hi, maybe we've found the final solution:
you must put the following code into the event "AddingNew" of the binding
source object:
if (gridTicketRows.Rows.Count == rowsBindingSource.Count){
rowsBindingSource.RemoveAt(rowsBindingSource.Count - 1);
return;
}
gridTicketRows is name of DataGridView, rowsBindingSource is name of
BindingSource.
good luck, :-)
Luke