Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

C# Collection of collections?

Posted on 2004-10-21
2
Medium Priority
?
326 Views
Last Modified: 2012-06-27
My question is this. I currently have a collection which is a collection of my own business object which is a representation of one of my SQL Server tables. This table has 2 columns: stateabbreviation | state (i.e. al | Alabama).

I have no problem getting this data into a collection and binding it to a repeater, but my itemtemplate is just a table row for each item which means I come up with a long vertical list such as:

Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas

What I really want is for it to display in 4 columns such as:
Alabama           Alaska           Arizona           Arkansas
California          Colorado       Connecticut      Delaware
Florida              Georgia         Hawaii             Idaho
Illinois               Indiana         Iowa                Kansas

My Question is: How do I reshape this datasource into this shape for my repeater?



0
Comment
Question by:NaderYacoub
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

by:
msdixon earned 2000 total points
ID: 12374560
here's an easy way...

Use a DataList instead, and set the RepeatColumns property to 4.
0
 
LVL 2

Author Comment

by:NaderYacoub
ID: 12374628
seems like an easy solution... thx alot. I am going to try now
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question