<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Alternating styles in ListView without AlternatingItemTemplate</title><link>http://weblogs.asp.net/bleroy/archive/2008/07/23/alternating-styles-in-listview-without-alternatingitemtemplate.aspx</link><description>ListView (the server-side control), like all repeating data controls in ASP.NET, has an AlternatingItemTemplate , but it would be a shame to have to copy all the markup in the ItemTemplate into AlternatingItemTemplate , just to alternate styles on the</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>re: Alternating styles in ListView without AlternatingItemTemplate</title><link>http://weblogs.asp.net/bleroy/archive/2008/07/23/alternating-styles-in-listview-without-alternatingitemtemplate.aspx#6778243</link><pubDate>Thu, 11 Dec 2008 14:42:43 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6778243</guid><dc:creator>richardneverett</dc:creator><author>richardneverett</author><description>&lt;p&gt;Just as I was about to go jQuerying...!&lt;/p&gt;
&lt;p&gt;Very helpful post, many thanks.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6778243" width="1" height="1"&gt;</description></item><item><title>re: Alternating styles in ListView without AlternatingItemTemplate</title><link>http://weblogs.asp.net/bleroy/archive/2008/07/23/alternating-styles-in-listview-without-alternatingitemtemplate.aspx#6745644</link><pubDate>Tue, 18 Nov 2008 22:57:43 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6745644</guid><dc:creator>Winston</dc:creator><author>Winston</author><description>&lt;p&gt;Thanks for this tip. It really nice&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6745644" width="1" height="1"&gt;</description></item><item><title>re: Alternating styles in ListView without AlternatingItemTemplate</title><link>http://weblogs.asp.net/bleroy/archive/2008/07/23/alternating-styles-in-listview-without-alternatingitemtemplate.aspx#6539153</link><pubDate>Tue, 19 Aug 2008 17:41:38 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6539153</guid><dc:creator>Bertrand Le Roy</dc:creator><author>Bertrand Le Roy</author><description>&lt;p&gt;@JeffEsp: Are you using ListView or another data control?&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6539153" width="1" height="1"&gt;</description></item><item><title>re: Alternating styles in ListView without AlternatingItemTemplate</title><link>http://weblogs.asp.net/bleroy/archive/2008/07/23/alternating-styles-in-listview-without-alternatingitemtemplate.aspx#6538367</link><pubDate>Tue, 19 Aug 2008 13:11:29 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6538367</guid><dc:creator>JeffEsp</dc:creator><author>JeffEsp</author><description>&lt;p&gt;This didn&amp;#39;t work for me until I added a cast to IDataItemContainer like so:&lt;/p&gt;
&lt;p&gt;((IDataItemContainer)Container).DisplayIndex % 2 == 0 ? &amp;quot;even&amp;quot; : &amp;quot;odd&amp;quot; &lt;/p&gt;
&lt;p&gt;Any ideas why?&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6538367" width="1" height="1"&gt;</description></item><item><title>re: Alternating styles in ListView without AlternatingItemTemplate</title><link>http://weblogs.asp.net/bleroy/archive/2008/07/23/alternating-styles-in-listview-without-alternatingitemtemplate.aspx#6470960</link><pubDate>Sat, 02 Aug 2008 12:35:09 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6470960</guid><dc:creator>Mike.Borozdin</dc:creator><author>Mike.Borozdin</author><description>&lt;p&gt;Good idea indeed!&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6470960" width="1" height="1"&gt;</description></item><item><title>re: Alternating styles in ListView without AlternatingItemTemplate</title><link>http://weblogs.asp.net/bleroy/archive/2008/07/23/alternating-styles-in-listview-without-alternatingitemtemplate.aspx#6452090</link><pubDate>Mon, 28 Jul 2008 01:51:49 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6452090</guid><dc:creator>jao</dc:creator><author>jao</author><description>&lt;p&gt;cool! reminds me of those techniques from the classic asp style. =)&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6452090" width="1" height="1"&gt;</description></item><item><title>re: Alternating styles in ListView without AlternatingItemTemplate</title><link>http://weblogs.asp.net/bleroy/archive/2008/07/23/alternating-styles-in-listview-without-alternatingitemtemplate.aspx#6438734</link><pubDate>Thu, 24 Jul 2008 11:35:14 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6438734</guid><dc:creator>kamii47</dc:creator><author>kamii47</author><description>&lt;p&gt;Wow.&lt;/p&gt;
&lt;p&gt;Very good idea we can implement that in othere areas also like gridview e.t.c&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6438734" width="1" height="1"&gt;</description></item><item><title>re: Alternating styles in ListView without AlternatingItemTemplate</title><link>http://weblogs.asp.net/bleroy/archive/2008/07/23/alternating-styles-in-listview-without-alternatingitemtemplate.aspx#6438581</link><pubDate>Thu, 24 Jul 2008 10:48:56 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6438581</guid><dc:creator>Evgenij</dc:creator><author>Evgenij</author><description>&lt;p&gt;Yeah. Thanx, really cool.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6438581" width="1" height="1"&gt;</description></item><item><title>re: Alternating styles in ListView without AlternatingItemTemplate</title><link>http://weblogs.asp.net/bleroy/archive/2008/07/23/alternating-styles-in-listview-without-alternatingitemtemplate.aspx#6438575</link><pubDate>Thu, 24 Jul 2008 10:47:17 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6438575</guid><dc:creator>Andrei Rinea</dc:creator><author>Andrei Rinea</author><description>&lt;p&gt;Great tip! Simple and effective.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6438575" width="1" height="1"&gt;</description></item><item><title>re: Alternating styles in ListView without AlternatingItemTemplate</title><link>http://weblogs.asp.net/bleroy/archive/2008/07/23/alternating-styles-in-listview-without-alternatingitemtemplate.aspx#6437656</link><pubDate>Thu, 24 Jul 2008 04:14:19 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6437656</guid><dc:creator>CareySon</dc:creator><author>CareySon</author><description>&lt;p&gt;wow..i think it&amp;#39;s a great way.more simple and less code:-)&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6437656" width="1" height="1"&gt;</description></item></channel></rss>