By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,417 Members | 904 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,417 IT Pros & Developers. It's quick & easy.

Avoiding empty cells in a DataList

P: n/a
I have a DataList with a RepeatColumns property that has a value of 3.
However, when the number of items is not divisible by 3, I have blank cells
at the end of the list, which makes the DataList look somewhat ugly. Is
there a way to avoid this? Thanks.

I also use an AlternatingItemTemplate with a different BackColor property
than my ItemTemplate. However, depending on the number of items my DataList
might end up looking like a checkerboard if the first itemtype in each
column is different. Is there some way to "reset" the itemtype for each
column? I would rather not need to set the BackColor manually for each item
using the ItemDataBound event. Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Don't use AlternatingItemTemplate. Rather use PreRender event to loop
through the items and set their BackColor depending on the item position in
the row.

Eliyahu

"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
I have a DataList with a RepeatColumns property that has a value of 3.
However, when the number of items is not divisible by 3, I have blank cells at the end of the list, which makes the DataList look somewhat ugly. Is
there a way to avoid this? Thanks.

I also use an AlternatingItemTemplate with a different BackColor property
than my ItemTemplate. However, depending on the number of items my DataList might end up looking like a checkerboard if the first itemtype in each
column is different. Is there some way to "reset" the itemtype for each
column? I would rather not need to set the BackColor manually for each item using the ItemDataBound event. Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.