I have a grid view control to which an edittemplate has two dropdownlist control called DropStartTime and DropEndTime. For both controls I want to fill with time values I use the following code to do so:
Public Sub GenerateTime(RowIndex As Integer)
Static Dim ComboStart As DropDownList
Static Dim ComboEnd As DropDownList
Dim ItemList As ListItem
Dim TimeInterval As Integer
Dim IntervalleCalcul As Integer
Dim NombreIntervalles As Integer
Dim HeureCalcule As String
Dim Laps As Integer
ComboStart = GridDetails.Rows(RowIndex).FindControl("DropStartTime")
ComboEnd = GridDetails.Rows(RowIndex).FindControl("DropEndTime")
If Not (IsNothing(ComboStart) Or IsNothing(ComboEnd)) Then
ComboStart.Items.Clear()
ComboEnd.Items.Clear()
' --------------------------------------------
...
Go to the complete details ...