change dimensions of a gridview
as it is I have a GridView
with 2 colums (consent -> checkbox) and the name of the profile. it has 12 rows. I have to make the GirdVi开发者_开发百科ew 3x4 or 4x3. How can I do that? Thanks in advance!
GridView
displays data in 2D table one row for each record and one cell for each property so to achieve 3x4 or 4x3 you can use ListView
check this post and this post
You can use Either Datalist Control or ListView Control to Show Data in Multiple Columns
you can use Datalist for showing data in 4X3 format as follows:
<asp:DataList ID="DataList1" runat="server" RepeatColumns="3" Width="100%">
<ItemTemplate>
<table align="center" cellpadding="0" cellspacing="0">
<tr>
<td><asp:CheckBox runat="server"></asp:CheckBox></td>
<td><%#Eval("name") %></td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
We can use RepeatColumns="3" property of Datalist to show Data in 3 Columns.
May this answer help you.
精彩评论