Solved

How to use a Gridview to display data horizontally

Posted on 2010-09-22
4
1,126 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 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