Hi,
Try this instead. In the designer set the bindingnavigators
deleteitem to none. The delete button should still be there. Double click
on the delete button to get the code window to open up with the
BindingNavigatorDeleteItem_Click event open. Add the code below to control
the delete.
Private Sub BindingNavigatorDeleteItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BindingNavigatorDeleteItem.Click
If MessageBox.Show("Are you sure?", "", MessageBoxButtons.YesNo) =
Windows.Forms.DialogResult.Yes Then
ContactBindingSource.RemoveCurrent()
End If
End Sub
Ken
-------------------------
"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:e5**************@TK2MSFTNGP11.phx.gbl...
Doesn't seem to work for me. The msgbox never appears. I am using the
BindingNavigator. Do I need to change anything at that end?
Regards
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:e5*************@TK2MSFTNGP15.phx.gbl... Hi,
I wish the bindingnavigatordelete_click event allowed you to
cancel the delete of the row. If you are bound to a dataset you can add
a handler to the rowdeleted event and undo the delete. Not the best
solution but it works
AddHandler AdventureWorksDataSet.Tables(0).RowDeleted, AddressOf
Row_Deleting
Private Shared Sub Row_Deleting(ByVal sender As Object, _
ByVal e As DataRowChangeEventArgs)
If MessageBox.Show("Are you sure?", "", MessageBoxButtons.YesNo) =
Windows.Forms.DialogResult.No Then
e.Row.RejectChanges()
End If
End Sub
Ken
----------------
"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:%2******************@tk2msftngp13.phx.gbl... Hi
When I press the delete button on the BindingNavigator it deletes the
record without any warning. How can I add a warning dialog when the
delete button on the BindingNavigator is pressed and before the record
is actually deleted?
Thanks
Regards