Mi dice che ho l'indice fuori...dove sbaglio?scusate,non ho ancora capito benissimo la relaizione che intercorre tra datagridview e datatable collegatacodice:Private Sub CancellaSelBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CancellaSelBtn.Click Dim i As Integer For i = 0 To (Me.Turnides_TURNOLAVORATORIDataGridView.Rows.Count - 1) If (CBool(Me.Turnides_TURNOLAVORATORIDataGridView(Selezioneassegnati.Index, i).Value) = True) Then Dim codlavoratoredgv As Integer = CInt(Me.Turnides_TURNOLAVORATORIDataGridView(dgvColLavoratore.Index, i).Value) For Each row As movtestDataSet5.turnides_TURNOLAVORATORIRow In Me.MovtestDataSet5.turnides_TURNOLAVORATORI If row.LAVORATORE = codlavoratoredgv Then row.Delete() End If Next End If Next

Rispondi quotando
che sono diverse dal datatable associato nel caso ne abbia cancellate...?
ho risolto,basta fare il controllo al contrario,se cancello,controllo comunque la riga precedente e non devo gestire in maniera demoniaca indici