Solved

Rows to Columns

Posted on 2009-07-03
3
196 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:Cyber-spy
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 500 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

Technology Partners: 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

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…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

695 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