Solved

How to use a Gridview to display data horizontally

Posted on 2010-09-22
4
1,143 Views
Last Modified: 2012-05-10
I have a list of items which I would like to display on an ASP.Net web form. I am wondering whether it's possible to use the Gridview control to show the items in textboxes side by side as well as row by row, such as:

Name1 Name2 Name3 Name4
Name5 Name6 Name7 Name8
...............................................

and so on.

Thanks

Chris
0
Comment
Question by:CLoucas
4 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 167 total points
ID: 33732255
A grid wouldn't really be suitable for that sort of layout. You would be better off looking at the DataList:

     http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/datalist.aspx
0
 
LVL 12

Assisted Solution

by:jagssidurala
jagssidurala earned 167 total points
ID: 33732284
we can use datalist to display these type of design.

we are having datasource proprety for datalist also as like gridview.

.cs file code
----------------------------
dtList.DataSource = dtName;
dtList.DataBind();

here dtName is a DataTable having result set of Names.

.aspx code
-------------------------
<asp:DataList Id="dtList" runat="server" RepeatColumns="4" RepeatDirection="Horizontal">
<ItemTemplate>
<%#Eval("Name")%> //Name is database column name
</ItemTemplate.

</DataList>

0
 
LVL 3

Assisted Solution

by:ashokdudhade
ashokdudhade earned 166 total points
ID: 33732429
Please refer below URL
http://forums.asp.net/t/1354465.aspx
0
 

Author Closing Comment

by:CLoucas
ID: 33759528
Very good and prompt responses, thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

809 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