Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to cancel a Gridview row edit
Message
From
13/09/2012 14:22:53
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
How to cancel a Gridview row edit
Miscellaneous
Thread ID:
01552871
Message ID:
01552871
Views:
58
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
Next
Reply
Map
View

Click here to load this message in the networking platform