Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I zebra stripe a datalist in asp.net

Posted on 2013-05-17
2
Medium Priority
?
573 Views
Last Modified: 2013-05-17
I have a datalist populated by a dataset.  I'd like to zebra stripe it using only vb, or css.

How do I do this?
0
Comment
Question by:UnderSeven
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 total points
ID: 39175574
Give each alternating row its own class (e.g. even/odd). Add a CSS rule for each class that specifies the color you want each stripe to be. In your VB code you simply need to add logic that applies each class to every other row. You can look into handling the ItemDataBound event to accomplish this action.
0
 

Author Closing Comment

by:UnderSeven
ID: 39176018
I even had a itemdatabound event already coded for another purpose.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question