Gridview rowupdating event from code
Dear All, In Row Updating event of a Grid View I am trying to update the database picking the values of bound text Boxes in the Edit Item Templates. I confirmed update works by giving some other text vlaues instead of those retrieved from TB1, TB2, and TB3. I checked your code, it is working very good; below example of the code I used here... But Values retrieved from the tex Boxes are old values (not the newly typed in values in Edit mode) So in effect no updating is happening. Yes it is IF NOT Is Post Back, HAHAHAHA I am a more familier with VB ..missed to read that '!event is raised when a row's Update button is clicked, but before the Grid View control updates the row.This enables you to provide an event-handling method that performs a custom routine, such as canceling the edit operation, whenever this event occurs.A Grid View Edit Event Args object is passed to the event-handling method, which enables you to determine the index of the current row and to indicate that the edit operation should be canceled. Once I checked Is Post Back in Row Updating event.. Configuration; public partial class _Default1 : System. Actually last night I spent many hours on this issue .
Anyway I will check it and sort it out tell you Here is my defaukt1code. (may be some omissions happehed while cut/paste) //default1cs using System; using System. When I remove the databind method, the grid shrinks after update button is clicked (or on postback). Sql Client" Select Command="select * from [spiderwebs_region] order by name " Update Command="Update Region With History" Update Command Type="Stored Procedure" Delete Command="Delete Region With History" Delete Command Type="Stored Procedure" On Inserting="Sqldatasource1_Inserting" On Inserted="Sqldatasource1_Inserted" Insert Command="Insert Region With History" Insert Command Type="Stored Procedure" Hi, Thanks for your reply. For example: if the value of the description was "Hello how are you" and then the users hits Edit and changes this value to " am fine", in the C# file, the value obtained in the string description is still "Hello how are you". Now I moved this binding after querying module into the (! Is Post Back and click edit on the grid I no longer see the grid. How can I obtain the new value in string description?