473,385 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Avoiding empty cells in a DataList

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
1 1425
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rimu Atkinson | last post by:
hi all i use FindControl to get a textbox, and i get a textbox object, but it's ..Text property is empty. some background info: i have a DataList, which has a template column in it, and in...
1
by: Stephan Bour | last post by:
I need to build a string from the content of a datalist containing a nested datagrid. This properly returns the data from the first cell in the datagrid: String first = GridItem.Cells.Text; ...
1
by: Nathan Sokalski | last post by:
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...
1
by: Rimu Atkinson | last post by:
hi all i use FindControl to get a textbox, and i get a textbox object, but it's ..Text property is empty. some background info: i have a DataList, which has a template column in it, and in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.