What is the best way to do this

G

Guest

Hello
I have a data repeater control. Each row has set of controls with its own
data sources; DropDownList,TextBox and buttons. User can add new rows, delete
excisting rows and enter data.
When user is done entering data and submits the form (clicks "save" button)
what is the easiest way to retrieve all data stored in repeater control? Is
looping through Item collection the right way to go about it?
Thank you
 
Y

Yunus Emre ALPÖZEN

Hello,
Make each row as a user control and add this user control into repeater
itemtemplate. Add a property to this usercontrol with get and set. On get
process controls and return DataRow(or what ever your type that you used).
On Set assign values from DataRow to controls..
your code would be seem so;
foreach(RepeaterItem item in r.Items )
{
///
}
Iterating repeater item is expected and usual way.

Thanks,
Yunus EmreALPÖZEN
 

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,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top