Laying out data with the ASP.NET data controls
I am trying to learn about ways to layout my data from a database using ASP.NET and C#
I can layout my data without any problem in rows using things like the GridView control, as the below image illustrates.
However I want to layout all of the information that would normally be in 1 row, in 1 cell.
So for example, each row would have 3 cells, each cell containing all of the information from 1 database row, as the image below illustrates.
Is there any way to do开发者_运维知识库 this with the existing ASP.NET controls, for example with a Gridview, or do I have to just build the table myself?
Any help would be greatly appreciated.
You can achieve this using asp.net DataList server control. Its very similar to Repeater except you can also display data horizontally using RepeatColumns property. For more detail on using please have a look at http://www.builderau.com.au/program/dotnet/soa/Formatting-data-in-columns-with-ASP-NET-s-DataList-control/0,339028399,339270702,00.htm and http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datalist.repeatcolumns.aspx
精彩评论