Jump to content

Recommended Posts

Posted

Hi all, it's probably a 'not possible' but i thought i'd ask

I'm using the html repeater to display some results from a db query.

I would like to break the printable page after 5 results by entering some javascript : >>>PAGE-BREAK-BEFORE: always

but using the repeater i cannot work out how to either make it count back to the generating page, or count internally.?? does that make sense?

Any pointers, even negative most appreciated.

Will

Guest gadgetfbi
Posted

Maybe I have you wrong, is this in a mobile web form - in which case it is not permitted as far as I understand. But as for aspx web forms, there is no paging function for the repeater control, is it a situation in which the datagrid could be used. It has some nice, expandable paging functions.

[Edit]

Come to think of it you could use a repeater, and page your datasource by splitting it some how, using some request parameter to indicate which 'page' of the data you wish to bind with.

[/Edit]

Rob

Posted

Just cracked it .. the ItemCreated Event!!

 private void Repeater1_ItemCreated(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)

 {

 if (incrimenter == 5){Label1.Text="<P CLASS='breakhere'>";

 incrimenter=1;}else{Label1.Text="";incrimenter++;}

 ;

 }[/code]

this actually worked, but it calls for all items including headers and footers.

Thanks for the response tho..

Will

Guest woweezowee
Posted

just add

if( e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem )

{

...

}

this will skip the header, footer, seperator items

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.