0

enter image description here

Please help me to solve this error as I tried in more than one way When I try to change in cell number 5, the error appears, but the error does not appear if I try to change in any other cell

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        For item As Integer = 0 To Employee_Shift_DetailDataGridView.RowCount - 1
           
            Employee_Shift_DetailDataGridView.Rows(item).Cells(5).Value = "001"
            
        Next
    End Sub

Thanks.

I tried to change the selection mode

Dale K
  • 25,246
  • 15
  • 42
  • 71
Arm Lion
  • 1
  • 1
  • 4
    Obviously there are not six columns in your grid then. – jmcilhinney Dec 08 '22 at 09:15
  • As per the question guide, please do not post images of code, data, error messages, etc. - copy or type the text into the question. Please reserve the use of images for diagrams or demonstrating rendering bugs, things that are impossible to describe accurately via text. – Dale K Dec 08 '22 at 10:16
  • Nothing to do with SQL Server – Dale K Dec 08 '22 at 10:16
  • You are databinding, why not just change the appropriate object in the datasource `bs`? – djv Dec 08 '22 at 19:53

0 Answers0