473,396 Members | 2,052 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,396 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 1609
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.