Then again we have to call that Bind Grid Data () method to bind data for the textboxes. You can leave a response, or trackback from your own site.
So once after done with editing data, if we click update the following method will be triggered. Once we access the required fields in the code behind, we need to update the data in the database and show the updated data to the user. If the user clicks the Delete button On Row Deleting event will be fired. Going into that code we are trying to get the primary key of the employee table(Employee ID) by using Grid View Data Key Names and then This entry was posted on March 27, 2009 at am and is filed under ASP.
Your Grid View needs a Data Key Names set in order to keep track of the primary keys of your data objects.
SET NOCOUNT ON; -- Insert statements for procedure here DELETE tbl_Service from tbl_Service where Service_ID = @Service_ID select * from tbl_Service END i am not able to get the proper rowindex to delete the record I am not sure why you think that posting the same, or similar code over and over again is going to help....
The above piece of code will also do the same as label in Item Template and Textbox in the Edit Item Template.
By default all the boundfields will be trasferred as Textboxes in Edit Mode.
If you have any compliments or complaints to MSDN Support, feel free to contact [email protected]
A datakey represents the primary key field or field of a record that can uniquely identify it in a data-bound control. Row Index represents the index of the particular row.If we use proper command names for the buttons like “EDIT”, “DELETE”, “UPDATE”, “CANCEL” these will also trigger the appropriate Grid View Events.Ok let’s move on to Code behind what we have to do when user clicks Edit, Delete, Update and Cancel When we click on Edit the On Row Editing event will be fired.Hi cms9651, Form your description and code, it is hard for me to understand your problem.Would you please provided more detailed description about you problem with complete code?