Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display rows in multiple columns in Asp.net Gridview

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?

like image 429
Malik Daud Ahmad Khokhar Avatar asked Aug 21 '08 13:08

Malik Daud Ahmad Khokhar


People also ask

How can create multi row header in GridView in ASP NET?

Let's see the HTML page which contains the single grid view and a button. In the HTML code shown above, I used some logic or trick -- I added a th tag and tr tag to create a multirow header, which is our requirement. Afterwards, I added some code in cs file for binding the grid view with the table.


1 Answers

You can use a DataList control instead. It has a RepeatColumns property that you can define the number of columns you want to display.

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.

like image 70
Serhat Ozgel Avatar answered Sep 21 '22 15:09

Serhat Ozgel