Solved

C# Collection of collections?

Posted on 2004-10-21
324 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
Question by:NaderYacoub
    2 Comments
     
    LVL 9

    Accepted Solution

    by:
    here's an easy way...

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

    Author Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    In this Experts Exchange video Micro Tutorial, I'm going to show how small business owners who use Google Apps can save money by setting up what is called a catch-all email address in their Gmail accounts. By using the catch-all feature, small busin…
    This video is in connection to the article "The case of a missing mobile phone (https://www.experts-exchange.com/articles/28474/The-Case-of-a-Missing-Mobile-Phone.html)". It will help one to understand clearly the steps to track a lost android phone.

    856 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now