Click here to Skip to main content
14,770,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using a data list to display data generated from database..
the data list has the repeat columns property set to 4 so it displays 4 items in each row, i need to display a separator after each row (html div or image),
I've tried to use the <separator template=""> but it didn't work as its repeated after each item..Can you please provide me with a way to do this.. thanks.
Posted
Comments
[no name] 1-Apr-12 15:09pm
   
Show what you have tried, then maybe we can give you suggestions

1 solution

Hi ,
try this :)
if (!IsPostBack)
        {
            var result = from x in Db.tests
                         select x;
            DataList1.DataSource = result;
            DataList1.DataBind();
        }

<div><asp:DataList ID="DataList1" runat="server">
<ItemTemplate >
                 <tr>
                 <td>
                    <asp:Label ID="Label1" runat="server"
                         Text="<%# Bind('name') %>"></asp:Label>
                         <hr />
                        </td>
                        <td>
                             <asp:Label ID="Label2" runat="server"
                         Text="<%# Bind('company') %>"></asp:Label>
                         <hr />
                               </td>

                        </tr>
                        </ItemTemplate>
        </asp:DataList>

</div>

Best Regards
M.Mitwalli
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900