Solved

Rows to Columns

Posted on 2009-07-03
3
190 Views
Last Modified: 2012-05-07
Hello:

I am trying to display this field into 3 columns instead of one long column.

 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" ShowHeader="False" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:BoundField DataField="ID"  />
           </Columns>
</asp:GridView>

0
Comment
Question by:RecipeDan
3 Comments
 
LVL 12

Expert Comment

by:Cyber-spy
Comment Utility
You are trying to split the 'ID' field across 3 columns, instead of one? Is this correct?

What is the format of your ID field? Can you give an example here?
0
 
LVL 1

Author Comment

by:RecipeDan
Comment Utility
Yes that is correct. ID is a text field. The ID column looks like this:

ID
Dan
Matt
John
Andy
Rohger
Sara
Bill
Bob

I want it to look like this:
Dan                    Matt               John
Andy                  Roger           Sara
Bill                      Bob

0
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
Comment Utility
try using DataList control like below.
Note the property: RepeatColumns="3
 <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1"
        RepeatColumns="3">
        <ItemTemplate>
            <asp:Label ID="FirstNameLabel" runat="server" Text='<%# Eval("ID") %>' />
        </ItemTemplate>
    </asp:DataList>

Instead of lable you can use li tags as well or any other kind of appropriate control
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

12 Experts available now in Live!

Get 1:1 Help Now