Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
hi all, I have a requirement that I need to show my records in a gridview like this:
HTML
image			image
name			name
address			address

image			image	
name			name	
address			address

and so on........	

I am unable to show my records like in the above format. Could it be possible in a grid view or I need to use any other control. please guide me.
Posted

Hi,

you can make use of Item template of the gridview template column. you can place any html pattern you want in that item template. and that will repeat for every row of the gridview.

Or even you make use of one gridview inside itemtemplate of the main gridview. and you can design inner gridview with 2 columns and 3 rows.

check this.

gridview nested inside another gridview in AspNet[^]

Gridview inside Gridview in ASP.NET C#[^]

http://csharpdotnetfreak.blogspot.com/2012/01/nested-gridview-inside-gridview-aspnet.html[^]

http://itdeveloperzone.blogspot.in/2010/11/gridview-inside-gridview-in-aspnet.html[^]

happy coding.
 
Share this answer
 
Comments
Vani Kulkarni 29-Jun-12 1:30am    
Good answer! 5!
Karthik Harve 29-Jun-12 1:33am    
Thanks.
tanweer 29-Jun-12 1:42am    
not what my requirement is..
tanweer 29-Jun-12 1:35am    
thanks for the reply, but I need to show two Rows(from database) and show these two in a single Row of the Gridview..
tanweer 29-Jun-12 1:41am    
I need two records in single row horizontally and then print another two records in the next row in same structure.
Finally I did it myself, using DataList we can display multiple rows horizentally with RepeatDirection="Horizontal"

more details HERE
 
Share this answer
 
Comments
panchalpuja 6-Mar-13 2:25am    
HI tanweer ... could u pls share the details .. i wish to achieve same functionality .. I have images and I wish to show them in column basis instead of rw basis...
Thanks ..
tanweer 6-Mar-13 23:39pm    
hi panchalpuja,
see this link, width RepeatDirection="Vertical", RepeatLayout="Table" and RepeatColumns="5" you can acive what you desire
Hi,

You can achieve this by using a ItemTemplate in which you can go for a table to display all these records
The other option is you can go with a Repeater Control

Thanks
www.alacraft.com.au
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900