Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends,

I have small code in gridview, data retriving from database.

Now db records are,

EmpId EmpName EmpAddress
------------------------
1. Raju Ban
2. Ravi Hyd
3. Ram Ban
4. Radha Hyd
5. Rajesh Mum


Now i want to display records as,

Raju Ravi Ram
Ban Hyd Ban


Radha Rajesh
Hyd Mum


please can any one help me. I am using bellow code. Thanks in advance.

<asp:TemplateField ItemStyle-VerticalAlign="Top" >
<itemtemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("EmpName")+""+Eval("EmpAddress") %>'>

Posted
Comments
ChauhanAjay 25-Aug-14 23:10pm    
It would be better if you could transpose the data using a query and then display it on the page.
Member 10021658 26-Aug-14 0:02am    
Good Morning ChauhanAjay,
Thanks for your response.
If you don't mind can you place the query?

1 solution

Best example with sample code...to display column horizontally in gridview
http://www.aspdotnet-suresh.com/2013/01/convert-gridview-columns-to-rows-in.html[^]
 
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