I am trying to achieve highlighting dates in the calendar.
Protected Sub Calendar1_DayRender(sender As Object, e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar1.DayRender For i As Integer = 0 To GridView1.Rows.Count - 1 Dim stringDate = GridView1.Rows(i).Cells(0).Text If Date.Parse(stringDate) = e.Day.Date Then e.Cell.BackColor = System.Drawing.Color.LightGreen notTouched = False End If Next End Sub But i am getting FormatException Error. String was not recognized as a valid DateTime. Btw i want my string format to be in date not datetime. Help me please.