Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to display data in different format

Status
Not open for further replies.

vcllvc

Programmer
Jul 12, 2001
136
US
Let say I have a GridView and databind to a list<int>, the gridview will display a column with the int on each row. Then I add another column to the gridview with a textbox on each row.
As below:

322 textbox1
833 textbox2
122 textbox3

Now, how can i display this rows horizontally as below.

322 833 122
textbox1 textbox2 textbox3

Which data control should I use? Or I have to create a table on the fly?

thanks in advance.

 
You will have to do this in sql, it's called a pivot table I belive. There are many examples in the SQL Server forum.
 
However, the list<int> is created dynamically, it's not from the database.
 
Ok, then you will have to loop though the original list and pull the value you want into a new list, transposing the rows into columns.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top