Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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:

'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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...