ItemDataBound question?

  • Thread starter Patrick Olurotimi Ige
  • Start date
P

Patrick Olurotimi Ige

I have one jscript in the ItemDataBound Method below
which loads a Calendar..
But i want o add another strTextBoxName2 string to the same method cos i
need to pass it to another Hyperlink2.
Any idea?

Private Sub dtgOrders_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dtgOrders.ItemDataBound

If e.Item.ItemType = ListItemType.EditItem Then
Dim strTextBoxName As String =
e.Item.Cells(0).FindControl("txtdate").ClientID()
CType(e.Item.FindControl("lbtnCalendar"),
HyperLink).NavigateUrl =
"javascript:calendar_window=window.open('DGCal.aspx?formname=Form1." &
strTextBoxName &
"','DatePicker','width=250,height=190,left=360,top=180');calendar_window
..focus();"


End If

End Sub
 
H

HoustonFreeways

Have you considered adding an attribute to a control at the onDataBound
method? Similar to below

Dim cbSelected As CheckBox = CType(e.Item.Cells(2).Controls(1),
CheckBox)

'add an attribute to the checkBox for client-side click
cbSelected.Attributes.Add("onclick",
"mainMatrixSimpleQuestionClick('" & CType(sender, DataGrid).ClientID & "',"
& e.Item.ItemIndex + 1 & ",'" & CType(sender, DataGrid).ClientID & "', 1);")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top