Friday 7 June 2019

To set auto increment id in datagridview

Private Sub DataGridView1_RowPrePaint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewRowPrePaintEventArgs) Handles DataGridView1.RowPrePaint
        If e.RowIndex >= 0 Then
            Me.DataGridView1.Rows(e.RowIndex).Cells(0).Value = e.RowIndex + 1
        End If
    End Sub

To download Website

https://drive.google.com/open?id=1zok6kqKcCSg3VJNft0evg6X1_4bbuKtG