Deleting last row of DataGridView

Hi, folks. Something is driving me crazy here.

I am currently using Visual Studio 2005 and have some trouble with DGV.

I have a DGV binded to a bindingsource and a typed dataset. I’m using the RowValidating event to, for exemple, tell the user if he missed to fill some columns of that row before commiting it. It works greate. But, when i delete the last row of my grid, the row for new values automatically gets focus and in edit mode. That way, I can't click save and update my database because the RowVlidating event is fired and there are blank cells on this row, since I don't want to edit this row. I can't cancel editing of this row even if a press Escape, what works perfectly whe the row for new values is not the unique row in my grid.

I hope you understood the problem and can help me.

Sorry for the bad english.

Thanks



Answer this question

Deleting last row of DataGridView

  • mike6271

    Someone, please!
  • Deleting last row of DataGridView