Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
table-1

column
aaa
bbb
ccc
ddd
eee

I have set of value in my column

I want to call this value in asp.net gridview row wise like,

gridview:(row wise)
---------

aaa bbb ccc ddd eee
Posted
Comments
[no name] 21-Aug-12 9:16am    
Okay.... you go right ahead and do that.
ridoy 21-Aug-12 9:18am    
Don't expect code from here..show us what you have tried?

Then you should go for other control for row wise like datalist, ListView, Repeater, etc..

DataList will be better for you.
 
Share this answer
 
v2
You have to use pivot.

Either at datatable level or in sql server level.

Check this for sql level

http://www.programmersheaven.com/mb/ASPNET/425735/425735/pivot-table-in-aspnet-gridview/[^]

also

at datatable level.
Pivoting DataTable Simplified[^]
 
Share this answer
 
created datatable,datatable1,datarow in memory.

C#
for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string strName = dt.Rows[i]["name"].ToString();
                    string value = strName;

C#
dt1.Columns.Add(strName);
                   dr.SetField(i, strName);
               }
               dt1.Rows.Add(dr);
               if (dt1 != null)
               {
                   DetailsView1.DataSource = dt1;
                   DetailsView1.DataBind();
               }
           }
 
Share this answer
 
v2

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