MasterChief,
Inside of the delete handler loop through the rows of the grid and look for
each checkbox. Then if the box is checked run a delete command based on that
row's id. Make certain that you set the GridView's DataKeyNames property to
the primary key field of your database so you can retrieve the row's id:
<asp:GridView ID="GridView1" runat="server" DataKeyNames="pk_InventoryId">
Dim CheckBox As CheckBox
Dim KeyId As Int32
For Each GridViewRow As GridViewRow In GridView1.Rows
'---Look at each checkbox here
CheckBox = CType(GridViewRow.FindControl("MyCheckBox"), CheckBox)
If CheckBox.Selected
'---Get the database id
KeyId = CType(GridView1.DataKeys.Item(GridViewRow.RowIndex ).Value,
Int32)
'---Use the KeytId to delete from the database.
End If
Next
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"MasterChief" <co*******@mix-net.net> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I have a customer that likes the gridview but instead of using the
standard Delete command for each row he wants to be able to put a
checkbox next to the row so he can chose multiple records and then
chose a delete button up top. What is the best way to accomplish that.
I have made a template in the gridview and added a checkbox. Then I
made a command button and changed is CommandName to Delete but after
that I don't really know what to do next.