Events in datagrid

lorena

Centurion
Joined
Oct 23, 2003
Messages
134
Location
Phoenix, Arizona
I have a datagrid with three date fields (among other fields) in it that loads from a database table. When the user edits the grid, there is a clickable image that triggers some javascript that opens a little window with a calendar control. When the user clicks the control, the date in the edit textbox is changed.
The grid was working fine until I added a dropdown to enable the user to select the type of records he or she wants to look at.
Now, when the grid is in edit mode, you can click on the image, the calendar loads but clicking on the calendar no longer changes the date in the textbox.
Why would the addition of the dropdown cause that to happen?
Here is the code for the calendar and the dropdown:
Visual Basic:
'This is part of the datagrid ItemDataBound
If e.Item.ItemType = ListItemType.EditItem Then
      'Set date for calendar control
      Dim sTextBoxName As String = e.Item.Cells(19).FindControl("txtEditStDate").ClientID()
      CType(e.Item.FindControl("lnkStCalendar"), HyperLink).NavigateUrl = _
      "javascript:calendar_window=window.open('Calendar.aspx?formname=frmReqs." & sTextBoxName & "','Pick_A_Date','width=180,height=210');calendar_window.focus();"
End If
'This is part of a BindData sub used to populate the datagrid
Select Case ddlView.SelectedIndex
      Case 0 'ALL
        objCommand.CommandText = "Requests_Read"
      Case 1 'PENDING
        objCommand.CommandText = "Requests_Pending"
      Case 2 'ACTIVE
        objCommand.CommandText = "Requests_Active"
      Case 3 'CLOSED
        objCommand.CommandText = "Requests_Closed"
        pnlMoYr.Visible = True
      Case 4 'ARCHIVE
        intMo = ddlMo.SelectedItem.Value
        intYr = ddlYr.SelectedItem.Value
        dtBeg = DateSerial(intYr, intMo, 1)
        dtEnd = DateSerial(intYr, intMo + 1, 1 - 1)
        strSQL = "SELECT * FROM toolroom_test " & _
                     "WHERE PRIORITY='DONE'  " & _
                     "AND COMPLETE_DATE BETWEEN #" & dtBeg & "# AND #" & dtEnd & "#"
    End Select
 
Back
Top