I have a number of pages that use a Repeater, like a spreadsheet for data entry.
The key would be in the save routine.
Here is some sample code I have taken from one such grid that saves information about stationery.
One key thing I do for existing records is add a hidden text box in the repeater that stores the primary key id for a record.
In some cases I use a temp table for the data and just append 5 or 10 blank records so that new records can be added.
This particular grid even has a file download control in each row so that images of each item can be downloaded as well.
Here is the relevant saving code:
*** Loop through each of the items in the RepeaterFOR lnX = 1 TORECCOUNT([c_Stationary])*-- calculate the form field name lcSort = this.rptStationery.UniqueID + "_txtSort_" + TRANSFORM(lnX) lcType = this.rptStationery.UniqueID + "_cboType_" + TRANSFORM(lnX) lcDesc = this.rptStationery.UniqueID + "_txtDesc_" + TRANSFORM(lnX) lcPrice = this.rptStationery.UniqueID + "_txtPrice_" + TRANSFORM(lnX) lcStationaryID = this.rptStationery.UniqueID + "_Stationaryid_" + TRANSFORM(lnX) lcUpload = this.rptStationery.UniqueID + "_txtFileUpload_" + TRANSFORM(lnX) lcFileName = [] lcJPGContent = Request.GetMultipartFile(lcUpload, @lcFilename)*-- locate the form data lnSortOrder = VAL(Request.Form( lcSort)) lnType = VAL(Request.Form( lcType)) lcStationaryDesc = Request.Form(lcDesc) lnStationaryPrice = VAL(Request.Form(lcPrice)) lnStationaryID = VAL(Request.Form(lcStationaryID))IF !EMPTY(lnStationaryID) loRec.Load(lnStationaryID) loRec.oData.SortOrder = lnSortOrder IF !EMPTY(lnType) loRec.oData.StationaryType = lnTypeENDIF loRec.oData.StationaryDesc = lcStationaryDesc loRec.oData.StationaryPrice = lnStationaryPriceIF !EMPTY(lcJPGContent)*-- save the file in the images\stationary directory lcFile = [/images/stationary/] + lcFileName lcSource = [e:\inetpub\wwwroot\images\stationary\] + lcFileNameSTRTOFILE(lcJPGContent, lcSource ) loRec.oData.ImageFile = lcFileENDIFIF !loRec.Save()this.ErrorDisplay.Text = loRec.cErrorMsgthis.lError = .T.EXITENDIFENDIFENDFOR
Bob