Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datawindow question

Status
Not open for further replies.

Pork

Technical User
Sep 24, 2002
5
CA
Hello:

I have a datawindow imbedded into a window. On the main window I put a delete button. The first column of the datawindow is a column called "mark", and it is on the datawindow as a checkbox (data values for the checkbox are y if selected and n if not). I want the user to be able to put a check in the mark checkbox next to all the rows he wants to delete and then all they have to do is click the delete button. The datawindow's name is dw_3. So basically...what I want to do is...if there is a checkmark in the checkbox (mark column from above), then delete the rows.

I hope someone can help me out with this. BTW...thanks for the help the other day on my posts...really appreciated it.

Alex
 
Hi Try this:
Code:
long ll_rows, i
integer li_del
ll_rows = dw_3.RowCount()

for i = 1 to ll_rows
	li_del = adw.GetItemString(i, "mark")
	if li_del = "y" then 
		adw.DeleteRow(i)
		i--
		ll_rows--
	end if
next
 
It would be less confusing to structure the loop as follows:

Code:
for i = ll_rows to 1
   li_del = adw.getitemstring(i,'mark')
   if (li_del = 'y') then adw.deleterow(i)
next

Matt

"Nature forges everything on the anvil of time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top