开发者

Laying out data with the ASP.NET data controls

开发者 https://www.devze.com 2023-01-26 17:20 出处:网络
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 illu

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.

Laying out data with the ASP.NET data controls

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.

Laying out data with the ASP.NET data controls

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

0

精彩评论

暂无评论...
验证码 换一张
取 消