473,398 Members | 2,343 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,398 software developers and data experts.

DataList <td onMouseOver>

I am trying to modify the onMouseOver attribute of a <td> cell created by a
DataList... according to

http://msdn.microsoft.com/library/de...classtopic.asp
"You can control the appearance of the DataGrid control by programmatically
adding attributes to the <td> and <tr> tags rendered by the control on the
browser. Attributes can be programmatically added by providing code in the
event handler for the OnItemCreated or OnItemDataBound event.
To add an attribute to the <td> tag, first get the TableCell object that
represents the cell in the DataGrid control you want to add the attribute
to. The Control.Controls collection for the Item property of the
DataGridItemEventArgs object passed into the event handler can be used to
get the desired TableCell object. You can then use the
AttributeCollection.Add method of the Attributes collection for the
TableCell object to add attributes to the <td> tag."
For the life of me, I cannot get the TableCell object that this page refers
to, can someone shed some light for me?
thnx
Nov 18 '05 #1
5 4669
In the OnItemCreated event of the datalist, you should be
able to reference e.Cells which through that heirarchy
should let you get a specific tablecell.

Also keep in mind, it looks like that article is speaking
about the datagrid specifically. I know some of the
lightweight record rending controls dont have all the same
events, or even the ability to acces e.DataItem from
databound/itemcreated events.

Weston Weems
-----Original Message-----
I am trying to modify the onMouseOver attribute of a <td> cell created by aDataList... according to

http://msdn.microsoft.com/library/default.asp? url=/library/en-
us/cpref/html/frlrfsystemwebuiwebcontrolsdatagridclasstopic
..asp

"You can control the appearance of the DataGrid control by programmaticallyadding attributes to the <td> and <tr> tags rendered by the control on thebrowser. Attributes can be programmatically added by providing code in theevent handler for the OnItemCreated or OnItemDataBound event.To add an attribute to the <td> tag, first get the TableCell object thatrepresents the cell in the DataGrid control you want to add the attributeto. The Control.Controls collection for the Item property of theDataGridItemEventArgs object passed into the event handler can be used toget the desired TableCell object. You can then use the
AttributeCollection.Add method of the Attributes collection for theTableCell object to add attributes to the <td> tag."
For the life of me, I cannot get the TableCell object that this page refersto, can someone shed some light for me?
thnx
.

Nov 18 '05 #2
No, it doesn't seem like you can access the e.Cells from the OnItemCreated
event.

any other ideas?
"Weston Weems" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
In the OnItemCreated event of the datalist, you should be
able to reference e.Cells which through that heirarchy
should let you get a specific tablecell.

Also keep in mind, it looks like that article is speaking
about the datagrid specifically. I know some of the
lightweight record rending controls dont have all the same
events, or even the ability to acces e.DataItem from
databound/itemcreated events.

Weston Weems
-----Original Message-----
I am trying to modify the onMouseOver attribute of a <td>

cell created by a
DataList... according to

http://msdn.microsoft.com/library/default.asp?

url=/library/en-
us/cpref/html/frlrfsystemwebuiwebcontrolsdatagridclasstopic
.asp


"You can control the appearance of the DataGrid control

by programmatically
adding attributes to the <td> and <tr> tags rendered by

the control on the
browser. Attributes can be programmatically added by

providing code in the
event handler for the OnItemCreated or OnItemDataBound

event.
To add an attribute to the <td> tag, first get the

TableCell object that
represents the cell in the DataGrid control you want to

add the attribute
to. The Control.Controls collection for the Item property

of the
DataGridItemEventArgs object passed into the event

handler can be used to
get the desired TableCell object. You can then use the
AttributeCollection.Add method of the Attributes

collection for the
TableCell object to add attributes to the <td> tag."
For the life of me, I cannot get the TableCell object

that this page refers
to, can someone shed some light for me?
thnx
.

Nov 18 '05 #3
DataList is not made out of cells. DataGrid is. DataList items are defined
in ItemTemplate. You can navigate within DataListItem only if you know what
is in your ItemTemplate.

Eliyahu

"Ryan Moore" <ry*******@hotmail.com> wrote in message
news:Oh****************@TK2MSFTNGP15.phx.gbl...
No, it doesn't seem like you can access the e.Cells from the OnItemCreated
event.

any other ideas?
"Weston Weems" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
In the OnItemCreated event of the datalist, you should be
able to reference e.Cells which through that heirarchy
should let you get a specific tablecell.

Also keep in mind, it looks like that article is speaking
about the datagrid specifically. I know some of the
lightweight record rending controls dont have all the same
events, or even the ability to acces e.DataItem from
databound/itemcreated events.

Weston Weems
-----Original Message-----
I am trying to modify the onMouseOver attribute of a <td>

cell created by a
DataList... according to

http://msdn.microsoft.com/library/default.asp?

url=/library/en-
us/cpref/html/frlrfsystemwebuiwebcontrolsdatagridclasstopic
.asp


"You can control the appearance of the DataGrid control

by programmatically
adding attributes to the <td> and <tr> tags rendered by

the control on the
browser. Attributes can be programmatically added by

providing code in the
event handler for the OnItemCreated or OnItemDataBound

event.
To add an attribute to the <td> tag, first get the

TableCell object that
represents the cell in the DataGrid control you want to

add the attribute
to. The Control.Controls collection for the Item property

of the
DataGridItemEventArgs object passed into the event

handler can be used to
get the desired TableCell object. You can then use the
AttributeCollection.Add method of the Attributes

collection for the
TableCell object to add attributes to the <td> tag."
For the life of me, I cannot get the TableCell object

that this page refers
to, can someone shed some light for me?
thnx
.


Nov 18 '05 #4
Yes, but the ItemTemplates ARE placed into TableCells... is there no way to
add an attribute to those cells?
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:OG**************@TK2MSFTNGP14.phx.gbl...
DataList is not made out of cells. DataGrid is. DataList items are defined
in ItemTemplate. You can navigate within DataListItem only if you know what is in your ItemTemplate.

Eliyahu

"Ryan Moore" <ry*******@hotmail.com> wrote in message
news:Oh****************@TK2MSFTNGP15.phx.gbl...
No, it doesn't seem like you can access the e.Cells from the OnItemCreated event.

any other ideas?
"Weston Weems" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
In the OnItemCreated event of the datalist, you should be
able to reference e.Cells which through that heirarchy
should let you get a specific tablecell.

Also keep in mind, it looks like that article is speaking
about the datagrid specifically. I know some of the
lightweight record rending controls dont have all the same
events, or even the ability to acces e.DataItem from
databound/itemcreated events.

Weston Weems

>-----Original Message-----
>I am trying to modify the onMouseOver attribute of a <td>
cell created by a
>DataList... according to
>
>http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/cpref/html/frlrfsystemwebuiwebcontrolsdatagridclasstopic
.asp
>
>
>"You can control the appearance of the DataGrid control
by programmatically
>adding attributes to the <td> and <tr> tags rendered by
the control on the
>browser. Attributes can be programmatically added by
providing code in the
>event handler for the OnItemCreated or OnItemDataBound
event.
>To add an attribute to the <td> tag, first get the
TableCell object that
>represents the cell in the DataGrid control you want to
add the attribute
>to. The Control.Controls collection for the Item property
of the
>DataGridItemEventArgs object passed into the event
handler can be used to
>get the desired TableCell object. You can then use the
>AttributeCollection.Add method of the Attributes
collection for the
>TableCell object to add attributes to the <td> tag."
>
>
>For the life of me, I cannot get the TableCell object
that this page refers
>to, can someone shed some light for me?
>thnx
>
>
>.
>



Nov 18 '05 #5
Try e.Item.Attributes["onmouseover"] = ...

Probably e.Item is the td you mean. Even if is it not, it should support
onmouseover event.

Eliyahu

"Ryan Moore" <ry*******@hotmail.com> wrote in message
news:e9****************@TK2MSFTNGP10.phx.gbl...
Yes, but the ItemTemplates ARE placed into TableCells... is there no way to add an attribute to those cells?
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:OG**************@TK2MSFTNGP14.phx.gbl...
DataList is not made out of cells. DataGrid is. DataList items are defined
in ItemTemplate. You can navigate within DataListItem only if you know

what
is in your ItemTemplate.

Eliyahu

"Ryan Moore" <ry*******@hotmail.com> wrote in message
news:Oh****************@TK2MSFTNGP15.phx.gbl...
No, it doesn't seem like you can access the e.Cells from the

OnItemCreated event.

any other ideas?
"Weston Weems" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
> In the OnItemCreated event of the datalist, you should be
> able to reference e.Cells which through that heirarchy
> should let you get a specific tablecell.
>
> Also keep in mind, it looks like that article is speaking
> about the datagrid specifically. I know some of the
> lightweight record rending controls dont have all the same
> events, or even the ability to acces e.DataItem from
> databound/itemcreated events.
>
> Weston Weems
>
>
>
> >-----Original Message-----
> >I am trying to modify the onMouseOver attribute of a <td>
> cell created by a
> >DataList... according to
> >
> >http://msdn.microsoft.com/library/default.asp?
> url=/library/en-
> us/cpref/html/frlrfsystemwebuiwebcontrolsdatagridclasstopic
> .asp
> >
> >
> >"You can control the appearance of the DataGrid control
> by programmatically
> >adding attributes to the <td> and <tr> tags rendered by
> the control on the
> >browser. Attributes can be programmatically added by
> providing code in the
> >event handler for the OnItemCreated or OnItemDataBound
> event.
> >To add an attribute to the <td> tag, first get the
> TableCell object that
> >represents the cell in the DataGrid control you want to
> add the attribute
> >to. The Control.Controls collection for the Item property
> of the
> >DataGridItemEventArgs object passed into the event
> handler can be used to
> >get the desired TableCell object. You can then use the
> >AttributeCollection.Add method of the Attributes
> collection for the
> >TableCell object to add attributes to the <td> tag."
> >
> >
> >For the life of me, I cannot get the TableCell object
> that this page refers
> >to, can someone shed some light for me?
> >thnx
> >
> >
> >.
> >



Nov 18 '05 #6

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

Similar topics

1
by: christian9997 | last post by:
Hi I was trying to create a page where a SubMenu would appear when the user moved the mouse over an item of a Menu (= Table Cell <TD>). Unfortunately there seems to be a problem; the onMouseOver...
0
by: Matt Adams | last post by:
I want to move the following <PRE> defintion to a css file: <TABLE><TR><TD><PRE>sample text</PRE></TD> <TD> not predefined font</TD></TR></TABLE> should be <TABLE><TR><TD class=aaa>sample...
3
by: Gil | last post by:
Hello, I use VB.NET and have a series of linkbuttons that are inside individual <td>s. Like this: <td background="image.gif"><asp:linkbutton id="myID" runat="server"/></td> I would like...
2
by: js | last post by:
I have a table rendered with XSLT. The first column has a radio button controls for user to make a selection for a particular row. All the values in the remaining columns are all concated with a...
7
by: Steve Klett | last post by:
I would like to have DHTML on my DataList so that when I hover over a cell, it will change colors. I can't find a way to get onMouseOver into the generated <td> from a DataList. There must be ...
2
by: leena | last post by:
My code is this <td bgcolor="#EBEBD8" onMouseOver="bgColor='#CBCBB8'"onMouseOut="bgColor='#EBEBD8'"> i want to put same hover colour on onclick function so how i write that code. If anybody know...
5
by: mahesr | last post by:
I want to match some particular text between <tr>and </tr> or <td>and </td>.... in PHP. like below............ <table><tr> CATEGORY: <td><font face="Verdana" size="1" color="#A000A0"> Wedding...
4
by: John | last post by:
I am attempting to make a table data row editable once clicked on but I am not sure how to show the <tdwith two different states. I've got it to the point where the <tdis hidden then appears within...
7
by: Xiaoyan | last post by:
Hi,everyone: I have a problem now. I can't get the information between the <tr><td> and </td></tr>. for example: I use this regular expression can't get it, I don't know why....
2
by: markszlazak | last post by:
I'm a relatively slow response of table cells changing their background color with mouseover/our in IE6 (Win 2K) but the response is fine (fast) in Firefox. Why? The code is below. Sorry about the...
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?
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.