Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
DataGrid1.DataSource = Nothing
DataGrid1.Columns.Clear()
Dim startDate As DateTime = DateTimePicker1.Value
Dim endDate As DateTime = DateTimePicker2.Value
Dim numberOfDays As Integer = (endDate.Date - startDate.Date).Days + 1
For dayCount As Integer = 0 To (numberOfDays - 1)
Dim currentDate As Date = Convert.ToDateTime(startDate.AddDays(dayCount))
Dim formatedD As String = currentDate.ToString("dd")
If currentDate.DayOfWeek <> DayOfWeek.Saturday AndAlso currentDate.DayOfWeek <> DayOfWeek.Sunday Then
Dim c1 As New DataGridViewColumn
c1.HeaderText = Format(currentDate, "MMM") & vbCrLf & formatedD
DataGrid1.Columns.Add(c1)
End If
Next dayCount
End Sub