I am trying to get a certain Layout based on the collection of data i have. I planned on using the DataList controll. I will have a collection of 16 items and was hoping to get the display in a two column layout ie:
1 2
3 4
5 6
7 8
Would the AlternatingItem Template be the template to use to achieve this
You could use ItemTemplate and AlternatingItemTemplate. Open a row in one, without closing. Close a row in the other without opening.
Or you could switch to ListView. That supports grouping in a static number of items scenario.
Superguppie.
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
When all you've got is a Hammer, Every Problem looks like a Nail. Michael Swain.
iggy985
Member
78 Points
53 Posts
Using the DataList
Jun 20, 2012 07:14 PM|LINK
I am trying to get a certain Layout based on the collection of data i have. I planned on using the DataList controll. I will have a collection of 16 items and was hoping to get the display in a two column layout ie:
1 2
3 4
5 6
7 8
Would the AlternatingItem Template be the template to use to achieve this
robwscott
Star
8079 Points
1491 Posts
Re: Using the DataList
Jun 20, 2012 07:39 PM|LINK
use repeater
<asp:Repeater id="Repeater1"> <HeaderTemplate> <div style="width:100%;"> </HeaderTemplate> <ItemTemplate> <div style="float:left; width:40%;"> <%# Eval("FirstName") %> </div> </ItemTemplate> <AlternatingItemTemplate> <div style="float:right; width:40%; margin-right:8%;"> <%# Eval("FirstName") %> </div> </AlternatingItemTemplate> <FooterTemplate> </div> <div style="clear:both;"></div> </FooterTemplate> </asp:Repeater>"FirstName" is an example property that you are using
Mark Answered if it helps - Good luck!
Cheers!
Design And Align
- Rob
superguppie
All-Star
48225 Points
8679 Posts
Re: Using the DataList
Jun 25, 2012 09:46 AM|LINK
You could use ItemTemplate and AlternatingItemTemplate. Open a row in one, without closing. Close a row in the other without opening.
Or you could switch to ListView. That supports grouping in a static number of items scenario.
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
When all you've got is a Hammer, Every Problem looks like a Nail. Michael Swain.