AlternatingItemTemplate in PageList

Vote:
 
Hi. I would like something like "AlternatingItemTemplate" in a PageList (to get a different background color on every other line). Is there someting like this built into the control or does anyone have an idea how to do it? /Markus
#12306
Jun 23, 2005 15:03
Vote:
 
Hi. I can think of two alternatives: 1. Operate with a counter that increments with 1 for each item in the pagelist, and check (with modulus) in ItemTemplate to see if you should render out f.ex. ... 2. Create your own PageList control (inherit from PageListData), create a new AlternatingItemTemplate in your new control, override CreateChildControls(), and put every second item into the AlternatingItemTemplate. If you have downloaded the SDK, you will see after packing out the files, that under the "source" folder, the actual sourcecode for the PageList is provided here for you to study. Frank :)
#14029
Jun 24, 2005 14:14
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.