locked
BindingNavigatorDeleteItem problem RRS feed

  • Question

  • BindingNavigatorDeleteItem problem

    I have a windows form in which is shown a single row from the concepts table

        Private Sub frmEC_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            'TODO: This line of code loads data into the 'DsHasbara.Concepts' table. You can move, or remove it, as needed.
            'Me.ConceptsTableAdapter.Fill(Me.DsHasbara.Concepts)
            Me.ConceptsTableAdapter.FillByID(Me.DsHasbara.Concepts, ECID)
        End Sub
       
    where ECID is set by the calling form

    I have the entire binding navigator on the form.

    What I want is when I click the     BindingNavigatorDeleteItem handler, that the form automatically update the database and close the form, rather than also having to click the save button on the bindinging navigator.

    I tried this
        Private Sub BindingNavigatorDeleteItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorDeleteItem.Click
            'Me.Validate()
            'Me.ConceptsBindingSource.EndEdit()
            'Me.ConceptsTableAdapter.Update(Me.DsHasbara.Concepts)
            'Me.Close()

        End Sub
    without the commenting out of course.

    The form closes all right, but the item remains in the calling form's list box.  If I click the delete first and then the save second, the item in the calling form's listbox is deleted.

    Can somebody tell me why?

    dennist685   
    Monday, March 13, 2006 6:47 AM