473,327 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

ItemDataBound question?

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.asp x?formname=Form1." &
strTextBoxName &
"','DatePicker','width=250,height=190,left=360,top =180');calendar_window
..focus();"
End If

End Sub


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #1
1 1607
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);")


"Patrick Olurotimi Ige" <ig*@iprimus.com.au> wrote in message
news:O9**************@TK2MSFTNGP14.phx.gbl...
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.asp x?formname=Form1." &
strTextBoxName &
"','DatePicker','width=250,height=190,left=360,top =180');calendar_window
.focus();"
End If

End Sub


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ben R. | last post by:
I've got a repeater that's bound to a datareader and I'd like to conditionally modify the text that is being outputted. Previously, I've done this by assigning a name to attribute to the...
1
by: TB | last post by:
Relatively new to .NET so please bear with me... I'm making an ASP.NET web application and am using VB to code. I'll try to set the stage here... The class and property names are generic to make...
2
by: Steve Klett | last post by:
Hi- I am developing a hierarchical navigation system. I have a DataList with the root level items, on the ItemDataBound event, I check for the selected item, when found I'm adding an additional...
3
by: Clouds | last post by:
Hi ! How do I add the dynamic event handler for a dropdownlist present in the itemtemplate of a datalist !! I am doing it in the itemdatabound event of the datalist but it doesnt work... I am...
1
by: Roy | last post by:
Hey all, This is a fairly broad question, but why is it that my datagrid hits the ItemDataBound event 3 times? Basically, I placed a response.write in all sub and functions in my codebehind and...
2
by: Ken Slight | last post by:
In C#, I use the following to bind ItemDataBound to a DataGrid: grid.ItemDataBound += new DataGridItemEventHandler(OnContentItemDataBound); Does anyone know the equivalent of this in vb.net? ...
1
by: greenb | last post by:
I'm using the ItemDataBound event of the DataGrid to highlight cells that are outside an acceptable range. Each row has a button column (CommandName='Select'), that is used to display addtional...
5
by: Nathan Sokalski | last post by:
I have a control that I want displayed in all items except the last one. I figured the best way to do this was to determine whether the current item was the last from within the ItemDataBound event...
1
by: Loading name... | last post by:
hey asp.net 2.0 I have a ItemDataBound event in my repeater control. My problem is that I don't know how to access the data in the ItemDataBound control. Lets say the datasource has a field...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.