What is the best way to do this

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Back
Top