Hope this article helps to begin working with Grid View control. Right now I have a label turn to visible true and a message when someone either edits or deletes something successfully.If you have a feedback or suggestion, please do write to me. Full Name: Sheo Narayan Member Level: Honorary Platinum Member Status: Administrator Member Since: 7/8/2008 PMCountry: India Regards, Sheo Narayan MVP, Author, Writer, Mentor & architecting applications since year 2001. What would you do if you wanted to have an event trigger when you click on the "cancel" button during the delete process. When a person starts to delete another item and decides to cancel the delete, the old message from the previously edited or deleted item still shows. ya,its how can I use the button field for the edit and delete in the template field.suppose i used that controls,what kind of events could I used for edit successfully? When Update link of the Grid View will be clicked (in edit mode), On Row Updating event will fire that will call Update Record method.In this method, we have to get changed values of Text Box and Drop Down list and also we need the primary key value for the record that is being edited.So I have to specify how I want them to appear in the normal view and edit view.That’s why I have placed different templates like Item Template (for normal view) and Edit Item Template (for edit view).In this article, I am going to take a simple database table that has following fields: Auto ID - Int, Auto Increment, Primary Key Page Name - Varchar(50) Page Description - Varchar(500) Active - Bit(1) In this article, I am not going to explain the workings of Sql objects but focusing on the events and methods of the Grid View that will help us in updating and deleting the records.
This article scope is limited to Updating and Deleting records using Grid View and I am not using any readymade Data controls for that but manually writing all event methods.After that again, I am doing the same thing that I had done in Cancel Record method, I mean setting Edit Index property of the Grid View to -1 and rebinding the data again by calling Bind Data() method.When Delete link of the Grid View will be clicked, it will confirm the user whether they really want to Delete the record, if they will click OK, it will fire On Row Deleting event of the Grid View that will call Delete Record method.I will be using Sql objects directly into methods to keep the example simple and straight forward.In practical scenario you should use your existing architecture to populate and update the data.