Gustav Brock
gustav at cactus.dk
Mon Oct 6 16:50:20 CDT 2008
Thanks Doug. Bedtime here, so I will have a look tomorrow.
/gustav
>>> dbdoug at gmail.com 06-10-2008 23:42 >>>
Interesting.. I didn't try it out myself - I'm just starting to use
vb.netand didn't have an easily set up program. StackOverflow is at
www.stackoverflow.com. You can find the original question and answer by
searching for the tag 'vb.net'.
I have to say that in the small amount of vb.net coding I've done so far,
finding events in vb that correspond to events in Access can be quite a
@#$%@& learning experience.
Doug
On Mon, Oct 6, 2008 at 2:28 PM, Gustav Brock <gustav at cactus.dk> wrote:
> Hi Doug
>
> You are most welcome. Could you provide a link, please?
>
> Problem is, however, that this suggestion was one of my first attempts -
> only to find out that this event is fired _after_ the actual deleting has
> been carried out - and as it carries no "Cancel" parameter or similar, it
> can only be used for something else you wish to do when that toolbarbutton
> has been clicked.
>
> While, coming from Access, I still wonder why this simple feature is not
> ready-built, I'm not in the mood to start modifying the native
> bindingnavigator as my workaround functions very well.
>
> As I wanted the deleted row (when confirmed) to be removed from the
> database at once, I included this code:
>
> private void dataGridView1_RowsRemoved(object sender,
> DataGridViewRowsRemovedEventArgs e)
> {
> if (e.RowCount > 0)
> {
> this.Cursor = Cursors.WaitCursor;
> // Delete from the source the deleted row.
> this.dessinNoBindingSource.EndEdit();
> this.productTableAdapter.Update(this.karnelia.Product);
> this.Cursor = Cursors.Default;
> }
> }
>
> This also executes after the user has selected a row and pressed the Delete
> key.
>
> /gustav