How can you get a .net DataItem with RepeatColumns = 2 AND alternate row styling?

I have a list of objects which need to be output 2 items per row, and with each alternate row to have a different background (using different CSS classes).

Currently, I'm using a DataList, binding the list to it, RepeatColumns=2, RepeatDirection="horizontal". ItemStyle and AlternatingItemStyle are being used to style the two columns. This results in the right layout but I can't figure out how to apply a different styling per row.

I am open to using any other controls to get the job done. There must be a way to achieve this without writing out the HTML manually:

Answers


One option is the repeater control. Much more flexible, but the trade off is that you have to build the templates for it yourself.

See http://msdn.microsoft.com/en-us/magazine/cc163780.aspx


Need Your Help

Smooth line after zooming

objective-c ios uikit quartz-core

I am trying to implement a drawing feature. Currently I am using UIBezierPath:

Portable encoding of 32 bit integers to communicate with an 8 bit device

c encoding portability 8bit

I need to communicate with an 8 bit device on which there is no nthol function. It is also impossible to use protocol buffers library.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.