473,802 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Repeater: Different StyleSheets for alternating rows

Hi All,

I am using ASP.NET Repeater Web Control.
I want to use different stylesheets for alternating rows similar to DataGrid
contorl.
How can I do this?

Thanks In Advance
Sachin

Jun 1 '07 #1
1 3278
Basic breakdown of what's avaiable:

<asp:Repeater id="Repeater1" runat="server">
<HeaderTemplate >
HTML and binding expressions here
</HeaderTemplate>
<ItemTemplate >
HTML and binding expressions here, CSS style class, e.g.
<div style="backgrou nd-color:#E0E0E0" stuff here </div>
</ItemTemplate>
<AlternatingIte mTemplate>
HTML and binding expressions , CSS style class, e.g.
<div style="backgrou nd-color:#FFCC66"a lternating stuff here </div>
</AlternatingItem Template>
<SeparatorTempl ate>
HTML and binding expressions
</SeparatorTempla te>
<FooterTemplate >
HTML and binding expressions
</FooterTemplate>
</asp:Repeater>

Cheers,
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Sachin" wrote:
Hi All,

I am using ASP.NET Repeater Web Control.
I want to use different stylesheets for alternating rows similar to DataGrid
contorl.
How can I do this?

Thanks In Advance
Sachin
Jun 1 '07 #2

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

Similar topics

2
1696
by: Scott | last post by:
I'm trying to display a table of my company's departments in a 3 column format with alternating row colors. The department names are being pulled from a database in alphabetical order. I want to order the depts in alphabetical order going from left to right in columns of 3 like: DeptA DeptB DeptC -- light colored row DeptD DeptE DeptF -- dark colored row I've figured out how to get the Depts. to display in the order I need them to...
2
359
by: Manny Chohan | last post by:
Hi Guys, I have a repeater control bound to a sqldataadapter. I have some rows which are quite large therefore wrapping on to second line. I want to substring the values on itemdatabound before displayed to user. Can this be done? or is there any better way to do it. Here is my code: <asp:Repeater id="evtRpeater" runat="server" OnItemDataBound="evt_ItemDataBound"> <HeaderTemplate> <Table width="100%" style="font: 8pt verdana">
9
2695
by: Max Weebler | last post by:
Hi, I have a datagrid built that has an alternating item style that sets the backcolor and ForeColor of its rows. I have 4 template columns. One of them has a LinkButton embedded in it to perform updates. All the styles that are set are being followed by all templated columns with the exception for the update column. The update column does set the BackColor appropriately but when setting its ForeColor the LinkButton's color is blue and...
1
1272
by: Jeff | last post by:
Hey asp.net 2.0 I have a repeater control in my webpage (you see my code below). In this control's ItemDataBound event I set the ImageUrl of a Image object. My problem is that when I run this webpage it shows only 1 image... -the repeater displays 2 rows, but it's only the first row that displays the image...
3
2082
by: shapper | last post by:
Hello, I am created an Asp.Net 2.0 repeater implementing the ITemplate class. I know my datasource, a datatable has 6 rows, but the repeater only displays the last one. If I add more rows to my datatable I keep seeing only the last record on my repeater. any idea why?
1
7134
by: jazzart | last post by:
Hi there, I'm fairly new to programming with Asp.Net 2.0 so I'm finding myself regularly fumbling around in the dark a bit, so to speak. I'm currently using Visual Web Developer and have been following the www.asp.net data access tutorials to create a DAL and BLL to connect my web site (a simple real estate property search web site) to my database (Sql Express 2005).
2
2380
by: John Kotuby | last post by:
Hi all, Thanks in advance for any suggestions... I am using a repeater to display the contents of a DataTable which is bound to it. All the rows in the table are being displayed. In the OnItemDataBound event controller in the Code Behind I am formatting the fields returned from the SQL server select query. The items are formatting correctly, except for those in the last row of the bound table. To test my theory, I added a row to the...
1
7617
by: Lloyd Sheen | last post by:
I have a repeater with header / item / alternate item and footer templates which works great (or at least ok). I want to put an <hr/tag as a separator but as soon as I put that in the output in no longer generated in any form that I can see as a pattern. The header starts the table, the footer ends it. The item has on <trwith 4 <td, the alternating item has <tr< with 3 <td> ( the 4th in the item is a <td style="width: 3px;...
3
3969
by: Emma Middlebrook | last post by:
Hi there, I've been trying to implement a repeater control in an ASP.NET 2 page but I can't seem to get the layout exactly how I want and I'm not sure if it's something that I am doing wrong or maybe the repeater control doesn't have the capabilities...? The page needs to display a custom number of sections that appear the same but have different data..
0
9699
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10285
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10063
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7598
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.