Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Datalist with more than one column

Reply
Thread Tools

Datalist with more than one column

 
 
Frank
Guest
Posts: n/a
 
      09-29-2004
Hi all,

I'm having this challenge:
I have a datalist, which I display in more than one column
(RepeatColumns="3") and RepeatDirection is horizontal. At the same time I
want to display an alternate background color on the every second item.

However, the number of items in the list is not always the same, and since
..NET seems to pick (for himself) what number of items to display in each
column, I can't control how it's going to come out in the browser.

To better illustrate (with the ItemTemplate's backgroundcolor as Gray, and
the AlternatingItemTemplate's backgroundcolor as Silver:

1. A list with 9 elements would display like this:

Gray Gray Gray
Silver Silver Silver
Gray Gray Gray

2. However, a list with 10 element would display like this:

Gray Gray Silver
Silver Silver Gray
Gray Gray Silver
Gray

What I'm asking is: is it possible to detect when the datalist is actually
starting a new column, so I can override or something? Or is there a better
way to fix this?

Any help or assistance is much appreciated. Thanks!
--
Regards,

Frank
 
Reply With Quote
 
 
 
 
Robert Koritnik
Guest
Posts: n/a
 
      09-30-2004
I think the best way would be to make your own event handler for
OnItemDataBound event and create TRs & TDs as needed...

--
RobertK
{ Clever? No just smart. }


"Frank" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all,
>
> I'm having this challenge:
> I have a datalist, which I display in more than one column
> (RepeatColumns="3") and RepeatDirection is horizontal. At the same time I
> want to display an alternate background color on the every second item.
>
> However, the number of items in the list is not always the same, and since
> .NET seems to pick (for himself) what number of items to display in each
> column, I can't control how it's going to come out in the browser.
>
> To better illustrate (with the ItemTemplate's backgroundcolor as Gray, and
> the AlternatingItemTemplate's backgroundcolor as Silver:
>
> 1. A list with 9 elements would display like this:
>
> Gray Gray Gray
> Silver Silver Silver
> Gray Gray Gray
>
> 2. However, a list with 10 element would display like this:
>
> Gray Gray Silver
> Silver Silver Gray
> Gray Gray Silver
> Gray
>
> What I'm asking is: is it possible to detect when the datalist is actually
> starting a new column, so I can override or something? Or is there a

better
> way to fix this?
>
> Any help or assistance is much appreciated. Thanks!
> --
> Regards,
>
> Frank



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Can one declare more than one signal on one line? Merciadri Luca VHDL 4 11-01-2010 02:00 PM
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com Java 0 03-06-2008 08:11 AM
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com C++ 0 03-05-2008 08:41 AM
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com C Programming 0 03-05-2008 03:26 AM
Setting up a datalist control - Item_DataBound for a datalist in a datalist Nevyn Twyll ASP .Net 8 09-09-2004 10:13 PM



Advertisments