mns
mns

Reputation: 683

Want 10 rows in every page while binding to a repeater

I have a repeater which is bound to a data source having 500 rows.I don't want it for paging. Simple when the rows are coming to repeater they grow down.So ,suppose i have 10 pages, each page having 50 rows in the browser print preview, when i am printing the document with ctrl+p command.

so,is there any way , so that my page will contain only 10 rows and with header and footer in every page.

Thanks Manas

Upvotes: 1

Views: 1177

Answers (1)

Aristos
Aristos

Reputation: 66641

You can add inside the repeater an if, then, Write call, using also a public integer value from code behind, as:

public int ImetritisReapeter = 1;

and on the page:

<asp:Repeater ID="rMyID" runat="server">
  <ItemTemplate>
    <% if (ImetritisReapeter++ % 10 == 0) { 
        Response.Write("<br>Extra header ever 10 lines");
    } %>
  </ItemTemplate>
</asp:Repeater>

Upvotes: 1

Related Questions