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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With