By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,559 Members | 1,180 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,559 IT Pros & Developers. It's quick & easy.

Adding controls to Repeater during runtime

P: n/a
Hi:

I'm using the Repeater control to display one-to-many relationship between
Customer, Orders and Order Items. To do this, I bind the control to
Customer table to show customer data, then call a function from item
template to generate Order and Order items which are returned as a string
containing HTML markup tags.

Since the Orders and Order items tables are not bound to Repeater I can't
add a button template. The button will have as it's command argument the
invoice number I'll use to take some action. So- it appears I'll have to
add button programmitcally in function like so...

System.Web.UI.WebControls.Button btn = new Button();
btn.Text = "Finalize Order";
btn.CommandArgument = child["invoice_no"].ToString();
Repeater1.Controls.Add(btn);

this correctly adds control to page but doesn't get wired up to Repeater's
Item_Command. How do you get it wired to Item_Command event so I can catch
the command argument?

Thanks,
Charlie
Nov 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.