I want to let the user select more than one row in a repeater so my application can act on all of them at one time?
A repeater control does not allow you to select more than one row at a time. But a repeater control is built on an underlying recordset. You can use the recordset and an unbound object in the repeater to give the user a way to select more than one row.
Every object in a repeater has a column in the recordset for the repeater, including any unbound objects. Power Objects adds columns for unbound objects to the recordset after all the bound columns and the ROWID column, and Power Objects does not give a title to unbound columns, so that you have to reference the column by its position in the recordset.
In order to let a user select multiple rows, you can add an object, such as a check box, that will let the user indicate that row is selected. If you were to use a check box with the name of
checkbox1 to a repeater named
repeater1 and the column for the check box was the fifth column in the recordset, you could access the value of the check box with the code:
To find all the rows selected with the check box, you would use looping code like this:
DIM nRows AS Integer, nPointer AS Integer
nRows = repeater1.GetRecordset().GetRowCount()
nPointer = 1
DO WHILE nPointer <= nRows
IF repeater1.GetRecordset().GetColVal(5) THEN
nPointer = nPointer + 1