Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert additional html into every 4th item of a Repeater 1

Status
Not open for further replies.

iaresean

Programmer
Mar 24, 2003
570
ZA
Hi All;

I am using a repeater to display a listing of products. There are to be a maximum of 4 records per row.

I would normally just use a div to hold each product with a float left assigned. Then the products would simply start on a new line based on the width of the holding div. However in this case, due to design, I cannot use this approach and have been forced into the use of tables.

What I am trying to achieve is to be able to insert a closing and opening 'tr' tag after every fourth item in my repeater. Does anybody know how I might be able to do this?

Thanks for any and all help;

Sean. [peace]
 
The only way you could do this would be to use the data bound event of the Repeater and keep a global variable to store the number of rows. However, you say that due to the design you have to use a table? Surely there is a method you can use to arrange the data as needed and it is just a case of you finding this method?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Hi ca8msm;

I have done exactly that (DataBound event + item counter). However, my problem comes into the actual insertion of the html code. Any idea how I might do that?

I am open to other ideas, it's just that the repeater seemed like the least complex solution to me.

Regards;

Sean. [peace]
 
To insert the HTML you could just use a Literal control and set it's Text property.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Sometimes the simplest of things can evade us for such a long time. :)

Thank you once again.

Sean. [peace]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top