Solved

How do I zebra stripe a datalist in asp.net

Posted on 2013-05-17
2
515 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 74

Accepted Solution

by:
käµfm³d   👽 earned 500 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now