I have a data list control with 3 columns. I want every second *row* to
have a dfferent CSS class. Can someone tell me how to access the parent
tablerow, and add a cssclass? I'm guessing I'll need to put some code in
the itemcreated or itemdatabound?
Thanks in advance,
Duncan
---/ snip /---
<asp:datalist id="dlRegionList" runat="server" repeatcolumns=3
cssclass="tbl" width="100%">
<itemtemplate>
<a href="search.asp?area=<%# DataBinder.Eval(Container.DataItem,
"Regions_ID") %>">
<%# DataBinder.Eval(Container.DataItem, "RegionName") %>
</a>
</itemtemplate>
<alternatingitemtemplate>
<!-- this needs to have: tr class="tbl_2row" -->
<a href="search.asp?area=<%# DataBinder.Eval(Container.DataItem,
"Regions_ID") %">
<%# DataBinder.Eval(Container.DataItem, "RegionName") %>
</a>
</alternatingitemtemplate>
</asp:datalist> 3 3682
Define an ItemTemplate and an AlternateItemTemplate. This allows you to have
every other item with a different format.
"Dunc" <du**@ntpcl.f9.co.uk> wrote in message
news:eC****************@TK2MSFTNGP09.phx.gbl... I have a data list control with 3 columns. I want every second *row* to have a dfferent CSS class. Can someone tell me how to access the parent tablerow, and add a cssclass? I'm guessing I'll need to put some code in the itemcreated or itemdatabound?
Thanks in advance,
Duncan
---/ snip /---
<asp:datalist id="dlRegionList" runat="server" repeatcolumns=3 cssclass="tbl" width="100%"> <itemtemplate> <a href="search.asp?area=<%# DataBinder.Eval(Container.DataItem, "Regions_ID") %>"> <%# DataBinder.Eval(Container.DataItem, "RegionName") %> </a> </itemtemplate>
<alternatingitemtemplate> <!-- this needs to have: tr class="tbl_2row" --> <a href="search.asp?area=<%# DataBinder.Eval(Container.DataItem, "Regions_ID") %"> <%# DataBinder.Eval(Container.DataItem, "RegionName") %> </a> </alternatingitemtemplate> </asp:datalist>
Marina,
Thanks for your reply. At the bottom of the post, I'd included the code -
including an itemtemplate and alternateitemtemplate; this doesn't work, as
we're effectively trying to style the whole parent row, not a single item.
Any thoughts?
D
"Marina" <so*****@nospam.com> wrote in message
news:O0****************@TK2MSFTNGP15.phx.gbl... Define an ItemTemplate and an AlternateItemTemplate. This allows you to have every other item with a different format.
"Dunc" <du**@ntpcl.f9.co.uk> wrote in message news:eC****************@TK2MSFTNGP09.phx.gbl...I have a data list control with 3 columns. I want every second *row* to have a dfferent CSS class. Can someone tell me how to access the parent tablerow, and add a cssclass? I'm guessing I'll need to put some code in the itemcreated or itemdatabound?
Thanks in advance,
Duncan
---/ snip /---
<asp:datalist id="dlRegionList" runat="server" repeatcolumns=3 cssclass="tbl" width="100%"> <itemtemplate> <a href="search.asp?area=<%# DataBinder.Eval(Container.DataItem, "Regions_ID") %>"> <%# DataBinder.Eval(Container.DataItem, "RegionName") %> </a> </itemtemplate>
<alternatingitemtemplate> <!-- this needs to have: tr class="tbl_2row" --> <a href="search.asp?area=<%# DataBinder.Eval(Container.DataItem, "Regions_ID") %"> <%# DataBinder.Eval(Container.DataItem, "RegionName") %> </a> </alternatingitemtemplate> </asp:datalist>
Try putting everything in each template into a div, with the appropriate
css class.
"Dunc" <du**@ntpcl.f9.co.uk> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl... Marina,
Thanks for your reply. At the bottom of the post, I'd included the code - including an itemtemplate and alternateitemtemplate; this doesn't work, as we're effectively trying to style the whole parent row, not a single item.
Any thoughts?
D
"Marina" <so*****@nospam.com> wrote in message news:O0****************@TK2MSFTNGP15.phx.gbl... Define an ItemTemplate and an AlternateItemTemplate. This allows you to have every other item with a different format.
"Dunc" <du**@ntpcl.f9.co.uk> wrote in message news:eC****************@TK2MSFTNGP09.phx.gbl...I have a data list control with 3 columns. I want every second *row* to have a dfferent CSS class. Can someone tell me how to access the parent tablerow, and add a cssclass? I'm guessing I'll need to put some code in the itemcreated or itemdatabound?
Thanks in advance,
Duncan
---/ snip /---
<asp:datalist id="dlRegionList" runat="server" repeatcolumns=3 cssclass="tbl" width="100%"> <itemtemplate> <a href="search.asp?area=<%# DataBinder.Eval(Container.DataItem, "Regions_ID") %>"> <%# DataBinder.Eval(Container.DataItem, "RegionName") %> </a> </itemtemplate>
<alternatingitemtemplate> <!-- this needs to have: tr class="tbl_2row" --> <a href="search.asp?area=<%# DataBinder.Eval(Container.DataItem, "Regions_ID") %"> <%# DataBinder.Eval(Container.DataItem, "RegionName") %> </a> </alternatingitemtemplate> </asp:datalist>
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: John Geddes |
last post by:
In both IE6 and Netscape 7:
insertRow method of tbody is behaving as expected:
- inserts a new row
- increases tbody.rows.length
BUT deleteRow is not doing the opposite.
It DOES delete the...
|
by: F. Da Costa |
last post by:
Hi,
I' looking to retrieve ProdName1 form the <tr> below.
<tr id="1-1-1" class="even">
<td>
<div class="tier4">
<a href="#" class="leaf"></a>
ProdName1
</div>
|
by: El Diablo |
last post by:
Hi there,
I'm trying dynamically generate extra rows in a table. So far this achieves
this task within the tHead segment:
theTable.tHead.appendChild(document.createElement('TR'))
....but...
|
by: Christopher Benson-Manica |
last post by:
I have an HTMLInputElement in a <td>. I want to access all the <td>'s
in the same row as the input element.
var tr=theInputElement.parentNode.parentNode;
Why isn't the input element's...
|
by: prefersgolfing |
last post by:
I'm not using Master Pages, yet I'd like to display the contents of an HTML
page within a <table><tr><td> on a .aspx.
I have a lengthy guide already paginated in html. I'd like to embed the...
|
by: petereffect |
last post by:
i have foll. code
<tr>
<a href="a1.shtml">
<td width='100%'>
"+Testing+
</td>
</a>
|
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...
|
by: jack |
last post by:
Hi all im Creating a report in HTML with the help of dotnet.. im
creating a which shows a data of 12 months .. the forst row of the
column contains month names.. and the following data..
The...
|
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....
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
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,...
|
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,...
|
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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...
|
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...
| |