PC Review


Reply
Thread Tools Rate Thread

Avoiding empty cells in a DataList

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      21st Sep 2005
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
(E-Mail Removed)
http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      22nd Sep 2005
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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
> (E-Mail Removed)
> http://www.nathansokalski.com/
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Avoiding empty cells showing as zero in line chart without na() ibjiba@gmail.com Microsoft Excel Charting 2 3rd Jan 2007 12:59 PM
Automatic avoiding empty cell Amag Microsoft Excel Charting 3 29th Jan 2006 05:37 AM
Avoiding empty cells in a DataList Nathan Sokalski Microsoft ADO .NET 1 22nd Sep 2005 09:27 AM
Avoiding empty cells in a DataList Nathan Sokalski Microsoft ASP .NET 1 22nd Sep 2005 09:27 AM
avoiding #ERROR in an empty report Sharon Microsoft Access Reports 6 9th Oct 2004 04:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:07 PM.