Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to cancel a Gridview row edit
Message
De
13/09/2012 14:22:53
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
How to cancel a Gridview row edit
Divers
Thread ID:
01552871
Message ID:
01552871
Vues:
57
Hi -

I have a Gridview displaying records from a complex query containing several joins and a UNION. Consequently I have to manage edits to this data manually. I expect to do this in the Gridview_RowUpdating event. After I have handled the edit, I need to cancel the Gridview's attempt to write to the underlying tables. I find that e.Cancel leaves the Gridview in editing mode. What is the proper way to cancel the automatic edit and return the Gridview to readonly mode?
Private Sub GridView1_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating
		Dim myTable As String = e.OldValues.Item("sourcetable")
		Dim myRecord As Int16 = e.OldValues.Item("KeyID")
		Dim newStatus As String = e.NewValues.Item("RTAStatus")
		MsgBox(myTable + ", " + myRecord.ToString + ", " + newStatus)

		' Handle data update here

		e.Cancel = True

	End Sub
Thanks
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform