Hi all I have never used the code-behind for updating a gridview and am having a couple of problems with it. I am trying to have the buttons Edit/Delete work. When I push the edit button the gridview blanks out and then if I make another selection it goes into edit mode... I am not sure how the delete part works either, the only part that works is the cancel edit button... this is what I have in VS 2005 VB
Protected Sub GridView1_RowCancelingEdit
(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.
GridViewCa
ncelEditEv
entArgs) Handles GridView1.RowCancelingEdit
GridView1.EditIndex = -1
GridView1.DataBind()
End Sub
Protected Sub GridView1_RowDeleted(ByVal
sender As Object, ByVal e As System.Web.UI.WebControls.
GridViewDe
letedEvent
Args) Handles GridView1.RowDeleted
End Sub
Protected Sub GridView1_RowDeleting(ByVa
l sender As Object, ByVal e As System.Web.UI.WebControls.
GridViewDe
leteEventA
rgs) Handles GridView1.RowDeleting
End Sub
Protected Sub GridView1_RowEditing(ByVal
sender As Object, ByVal e As System.Web.UI.WebControls.
GridViewEd
itEventArg
s) Handles GridView1.RowEditing
GridView1.EditIndex = e.NewEditIndex
GridView1.DataBind()
End Sub
Protected Sub GridView1_RowUpdating(ByVa
l sender As Object, ByVal e As System.Web.UI.WebControls.
GridViewUp
dateEventA
rgs) Handles GridView1.RowUpdating
End Sub
Are these all of the protected subs I need for doing this??
Thanks,
Randy
Start Free Trial