craigmacca
Member
- Joined
- Sep 25, 2007
- Messages
- 5
- Programming Experience
- Beginner
Hi i am new to .net and i have a template which loops through a gridview and deletes any items that are checked, with a onlick event
what i need to do is update a column to -1 instead of deleting.
can someone help me do this, been on this for 2 weeks now, and i cant see who to do it.
many thanks
what i need to do is update a column to -1 instead of deleting.
can someone help me do this, been on this for 2 weeks now, and i cant see who to do it.
many thanks
VB.NET:
For Each row As GridViewRow In GridView1.Rows
' Access the CheckBox
Dim cb As CheckBox = row.FindControl("ProductSelector")
If cb IsNot Nothing AndAlso cb.Checked Then
' Delete row! (Well, not really...)
atLeastOneRowDeleted = True
' First, get the Sock_ID for the selected row
Dim Sock_ID As Integer = _
Convert.ToInt32(GridView1.DataKeys(row.RowIndex).Value)
' "Delete" the row
DeleteResults.Text &= String.Format( _
"This would have deleted ProductID {0}<br />", Sock_ID)
'... To actually delete the product, use ...
'Dim productAPI As New ProductsBLL
'productAPI.UpdateProduct(Sock_ID)
'............................................
End If
Next