need some help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a datalist that has checkboxes in it and allows the user to select
certian things and be able to vew only the items selected. (like hotmail or
yahoo where you can select 1 or all and delete them) I'm NOT DELTETING THEM.
I need to view only the cheked items. I've tried everything I possiblly could
and still not working.
I was wondering if anyone else has ever done this or can point me to an
example that does this or somethign like this in either a datagrid or
datalist would work.
 
After the user has checked the checkboxes and clicked Submit, your first
action should be to loop through each row in the datalist, get the
checkbox in each row and if it's checked, save it somewhere. Then use
that list to do your processing.

Some psuedoCode:

' Button click handler

' Loop through each row
for each datarow in datagrid.items
' Try to get the checkbox object _
(you can filter by e.item.itemtype, too)
chkProcess= _
ctype(datarow.cells(0).controls.findControl _
("chkProcess"),Checkbox)

' If we got a checkbox and its checked, store the value
' probably an ID, in an Arraylist for later processing
if not chkProcess is nothing andalso chkProcess.checked then
alProcess.add(chkProcess.value)
end if

next

' Call your processing sub with the array of IDs you collected.
ProcessCheckedItems(ctype(alProcess.toArray(gettype(integer)),Integer())

Best of Luck!
 
Back
Top