Datagrid problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I have a Datagrid populated with data from a Dataview. My question is : When i press the [Delete] in a row, to display a confirmation box (yes/no). When the user selects No to abort the deletion

How can i do this, please? (to catch the [Delete] key from the datagrid with the keydown event doesn't work)

Somewhere, i read about to throw an exception in the RowUpdating event of the Dataview, but the Datagrid deletes the row anyway

Have you any idea (in VB.NET)

Thanks
Niko
 
Hi Nikos,

What kind of datagrid web or forms?

Second watch that the delete with dataset is a little bit strange command.
It delete from the datasource, however it deletes also the information that
it is deleted and therefore does nothing with an update.

For that you have to use the remove and the removeAt

I hope this helps for so far?

Cor
 
Hi Cor

In Windows forms. In previous versions of VB.NET there was the BeforeDelete event of the Datagrid (DBGrid) to cotnrol if the user actually wants to delete a row. Now, whenever the user presses the [Delete] it deletes directly the row in the datagrid and i don't know how to control this

Thanks, anyway
Nikos
 
Back
Top