add a row to a repeater

G

Guest

I have a repeater bound to a collection of business objects:

ScoresRepeater.DataSource = objReferralTestScore.TestScore;
ScoresRepeater.DataBind();

How can I add a "new" row to the repeater without adding to the collection
of bus objects?

Thanks in advance, Jack.
 
S

Steve Lutz

Jack,
If you're always going to be adding a row, it's it easier to just do:

objRefferaltestScore.TestScore.Add(new ObjName);

You can then use the Repeater.ItemDataBound event to look for when that row
is being rendered and change how it's rendered.

Here's info on the event:
http://msdn.microsoft.com/library/d...ebcontrolsrepeaterclassitemdataboundtopic.asp

Not the exact answer you're looking for.

Another option is to create a new custom control that inherits from
Repeater. This custom control would always adds a row at the end, probably
during the OnRender event handler.

HTH

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top