Ciao,
purtroppo non riesco a seguire la tua indicazione. Posto il codice scritto fin'ora
Public Class frmElencoFilm
Private Sub TblFilmBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TblFilmBindingNavigatorSaveItem.Click
lblTOT.Text = (TblFilmDataGridView.RowCount - 1)
Try
Me.Validate()
Me.TblFilmBindingSource.EndEdit()
Me.TblFilmTableAdapter.Update(Me.VideonoleggioDataSet.tblFilm)
MsgBox("Modifiche salvate correttamente", MsgBoxStyle.Information)
Catch ex As Exception
MsgBox("Verificare i dati", MsgBoxStyle.Critical)
End Try
End Sub
Private Sub frmElencoFilm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: questa riga di codice carica i dati nella tabella 'VideonoleggioDataSet.tblFilm'. È possibile spostarla o rimuoverla se necessario.
Me.TblFilmTableAdapter.Fill(Me.VideonoleggioDataSet.tblFilm)
lblTOT.Text = (TblFilmDataGridView.RowCount - 1)
End Sub
Private Sub btnChiudi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChiudi.Click
Try
Me.Validate()
Me.TblFilmBindingSource.EndEdit()
Me.TblFilmTableAdapter.Update(Me.VideonoleggioDataSet.tblFilm)
lblTOT.Text = (TblFilmDataGridView.RowCount - 1)
Catch ex As Exception
MsgBox("Verificare i dati", MsgBoxStyle.Critical)
End Try
Me.Close()
frmMain.Visible = True
End Sub
Private Sub TblFilmDataGridView_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles TblFilmDataGridView.CellContentClick
Dim form As New frmFilm()
TblFilmDataGridView.CurrentRow.Selected = True
If form.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK Then
TblFilmDataGridView.CurrentCell.Selected = frmFilm.IDFilmTextBox.Text
Else
MsgBox("errore")
End If
End Sub
End Class