Dim Dt_break As DropDownList = CType(e.Row.FindControl("BR_date"), DropDownList)
If Not IsNothing(Dt_break) Then
Dim ls_date As String
Dim ls_edate As String
ls_date = TextBox_start.Text
If ls_date <> "" Then
ls_edate = CStr(DateAdd(DateInterval.Day, 1, CDate(TextBox_end.Text)))
Do While ls_date <> ls_edate
Dt_break.Items.Add(New ListItem(ls_date, 0))
ls_date = CStr(DateAdd(DateInterval.Day, 1, CDate(ls_date)))
Loop
End If
End If
Dim ddl_break As DropDownList = CType(e.Row.FindControl("BR_date"), DropDownList)
If Not IsNothing(ddl_break) Then
Dim ls_date As String
Dim ls_edate As String
ls_date = TextBox_start.Text
ls_edate = TextBox_end.Text
If ls_date <> "" And ls_edate <> "" And ls_edate >= ls_date Then
dt.Columns.Add("Date")
ls_edate = CStr(DateAdd(DateInterval.Day, 1, CDate(ls_edate)))
Do While ls_date <> ls_edate
dr = dt.NewRow
dr("Date") = CStr(ls_date)
ls_date = CStr(DateAdd(DateInterval.Day, 1, CDate(ls_date)))
dt.Rows.Add(dr)
Loop
With ddl_break
.DataSource = dt
.DataTextField = "Date"
.DataValueField = "Date"
.DataBind()
End With
dt.Clear()
End If
End If