在Asp.net GridView的多列显示的行 [英] Display rows in multiple columns in Asp.net Gridview
问题描述
在默认情况下在连接到数据源的数据表或数据集的GridView映射到每一行的每一行。但是,如果我想要在多个列中显示这些行。例如,如果它有10行,5行,每行必须并排显示在2列一侧。我也能做到这一点用的Infragistics网格。这可能吗?
By default each row of a Gridview maps to each row in a datatable or dataset attached to its datasource. But what if I want to display these rows in multiple columns. For example if it has 10 rows, 5 rows each should be displayed in 2 columns side by side. Also can I do this with the Infragistics grid. Is this possible?
推荐答案
您可以使用<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datalist.aspx\"><$c$c>DataList$c$c>而不是控制。它有一个<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datalist.repeatcolumns.aspx\"><$c$c>RepeatColumns$c$c>属性,您可以定义要显示的列数。
You can use a DataList
control instead. It has a RepeatColumns
property that you can define the number of columns you want to display.
在.NET Framework 3.5的,有一个更好的解决方案,请查看<$c$c>ListView$c$c>控制。你可以找到关于如何在这里使用 ListView控件进一步的信息。
In .NET Framework 3.5, there is an even better solution, the ListView
control. You can find further information about how to use the ListView control here.
这篇关于在Asp.net GridView的多列显示的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!