Header

Wednesday, 23 May 2012

How to show 3 items in one row in repeater


It is easy to show two items in a single row in any Repeater but when we need to show more then two item in single row we face problem.
But everything have a solution and the solution is here
check this code it will help you to comeout from this problem.....


If anything is wrong let me know i will come back to ur problem.
And drop your Feedback tooooooooooooo :D



<table>
 <asp:Repeater ID="rptTest" runat="server">
  <ItemTemplate>
   <%# IIf(((Container.ItemIndex) Mod 3) = 0, "<tr>", "")%>
  <td>
   <asp:Label ID="getval" runat="server" Text='<%#Eval("Name")>'></asp:Label>
  </td>
   <%# IIf((Container.ItemIndex + 3) Mod 3 = 2,"</tr>", "")%>
  </ItemTemplate>
 </asp:Repeater>
</table>

No comments:

Post a Comment