e.g
suppose in grid this columns,
Mon1
Mon2
tues1
tues2
wed1
wed2
Private Sub dataGridView1_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles DataGridView1.Paint
Try
Dim colList ="Mon,tues,wed"
Dim clst As String() = colList.ToString.Split(",")
Dim j As Integer = 0
While j < DataGridView1.ColumnCount - 1
Dim r1 As Rectangle = Me.DataGridView1.GetCellDisplayRectangle(j, -1, True)
Dim w2 As Integer = Me.DataGridView1.GetCellDisplayRectangle(j + 1, -1, True).Width
r1.X += 0
r1.Y += 0
r1.Width = ((DataGridView1.ColumnCount / clst.Count) * w2)
r1.Height = r1.Height / 2
e.Graphics.FillRectangle(New SolidBrush(Me.DataGridView1.ColumnHeadersDefaultCellStyle.BackColor), r1)
Dim format As New StringFormat()
format.Alignment = StringAlignment.Center
format.LineAlignment = StringAlignment.Center
e.Graphics.DrawString(clst(j / ((DataGridView1.ColumnCount / (clst.Count + 1)) + 1)), Me.DataGridView1.ColumnHeadersDefaultCellStyle.Font, New SolidBrush(Me.DataGridView1.ColumnHeadersDefaultCellStyle.ForeColor), r1, format)
j += (DataGridView1.ColumnCount / clst.Count)
End While
Catch ex As Exception
End Try
End Sub
Happy Coding!
:)