?
Solved

Rows to Columns

Posted on 2009-07-03
3
Medium Priority
?
198 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
[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
3 Comments
 
LVL 12

Expert Comment

by:Adam
ID: 24774218
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
ID: 24774257
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 2000 total points
ID: 24774516
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month14 days, 1 hour left to enroll

800 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