Private Sub DataGridView1_RowPostPaint(sender As Object, e As System.Windows.Forms.DataGridViewRowPostPaintEventArgs) Handles DataGridView1.RowPostPaint
Dim SatirNo As String
Dim Boyut As SizeF
Dim Renk As Brush
SatirNo = (e.RowIndex + 1).ToString()
Boyut = e.Graphics.MeasureString(SatirNo, Font)
If (DataGridView1.RowHeadersWidth < CInt(size.Width + 1)) Then
DataGridView1.RowHeadersWidth = CInt(size.Width + 1)
End If
While SatirNo.Length < DataGridView1.RowCount.ToString().Length
SatirNo = "0" + SatirNo
End While
Renk = Brushes.DarkSlateGray
If e.RowIndex < DataGridView1.RowCount Then
e.Graphics.DrawString(SatirNo, MyBase.Font, Renk, e.RowBounds.Location.X + 10, e.RowBounds.Location.Y + ((e.RowBounds.Height - Size.Height) / 2))