Reputation: 3748
My GridView in only single column, how can I make it multicolumn?
There isn't an option to set column number in GridView properties.
Update :
Upvotes: 0
Views: 342
Reputation: 35514
Because it can be difficult to get a table with 4 columns in a Repeater, here a little example.
<table border="1">
<tr>
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<%# Container.ItemIndex %4 == 0 && Container.ItemIndex > 0 ? "</tr><tr>" : "" %>
<td><%# Eval("column") %></td>
</ItemTemplate>
</asp:Repeater>
</tr>
</table>
Upvotes: 1
Reputation: 2028
You cannot display GridView rows horizontally. A gridview is essentially an html table with each record displayed as new table row. You can try using a ListView or a Repeater to accomplish what you're trying to do.
Upvotes: 0