Rowupdating in gridview not working

05-Apr-2020 12:30

Debugger Inside Grid View Row Updating Event " data-medium-file="https://taditdash.files.wordpress.com/2014/06/debugger-inside-gridview-rowupdating-event.png? w=300" data-large-file="https://taditdash.files.wordpress.com/2014/06/debugger-inside-gridview-rowupdating-event.png? w=800&h=359 800w, https://taditdash.files.wordpress.com/2014/06/debugger-inside-gridview-rowupdating-event.png? w=150&h=67 150w, https://taditdash.files.wordpress.com/2014/06/debugger-inside-gridview-rowupdating-event.png? w=300&h=135 300w, https://taditdash.files.wordpress.com/2014/06/debugger-inside-gridview-rowupdating-event.png? w=768&h=345 768w, https://taditdash.files.wordpress.com/2014/06/864w" sizes="(max-width: 800px) 100vw, 800px" /Grid View on Browser " data-medium-file="https://taditdash.files.wordpress.com/2014/06/gridview-on-browser.png? w=230" data-large-file="https://taditdash.files.wordpress.com/2014/06/gridview-on-browser.png? w=150 150w" sizes="(max-width: 230px) 100vw, 230px" /Grid View Cell Showing Updated Value " data-medium-file="https://taditdash.files.wordpress.com/2014/06/gridview-cell-showing-updated-value.png? w=300" data-large-file="https://taditdash.files.wordpress.com/2014/06/gridview-cell-showing-updated-value.png? w=150 150w, https://taditdash.files.wordpress.com/2014/06/gridview-cell-showing-updated-value.png? w=300 300w" sizes="(max-width: 416px) 100vw, 416px" /Event.

w=800" src="https://taditdash.files.wordpress.com/2014/06/debugger-inside-gridview-rowupdating-event.png? w=800&h=359" alt="Debugger Inside Grid View Row Updating Event" width="800" height="359" class="size-full wp-image-328" srcset="https://taditdash.files.wordpress.com/2014/06/debugger-inside-gridview-rowupdating-event.png? w=230" src="https://taditdash.files.wordpress.com/2014/06/gridview-on-browser.png? w=800" alt="Grid View on Browser" class="size-full wp-image-335" srcset="https://taditdash.files.wordpress.com/2014/06/230w, https://taditdash.files.wordpress.com/2014/06/gridview-on-browser.png? w=416" src="https://taditdash.files.wordpress.com/2014/06/gridview-cell-showing-updated-value.png? w=800" alt="Grid View Cell Showing Updated Value" class="size-full wp-image-331" srcset="https://taditdash.files.wordpress.com/2014/06/416w, https://taditdash.files.wordpress.com/2014/06/gridview-cell-showing-updated-value.png?

i thought i had binded it in postback n removed it frm page load but after looking at the code again got to know wat was the mistake....

I have a Gridview with Auto Generate Columns="False".

One has it's Command Name = "Update" and the other "Cancel".

My problem lies in that the click on the Update Image Button posts back, but neither the Row Command nor Row Updating events get triggered.

Yes, I did put the breakpoint at the Row Updating line (and not in the function).

Right now, I have not written code for the Update event. Right now, I have not written code for the Update event. Then the page posts back, the text boxes go back to being labels and the new values are lost, and the Row Updating code never fires.

For a while now I’m trying to figure out why my method, triggered by the Grid View.

Row Updating event, doesn’t work as all samples say it should do.

Find Control("Text Box1"))); All this coded thing is not working.

Used breakpoints and checked, its showing the same existing values which is there before editing. aspx code protected void Page_Load(object sender, Event Args e) public static User Principal Get User Principal(String user Name) protected void Get Year() protected void Get Month() public void Grd Get Comments() protected void Btn Save_Click(object sender, Event Args e) protected void gv Data_Row Editing(object sender, Grid View Edit Event Args e) protected void gv Data_Row Canceling Edit(object sender, Grid View Cancel Edit Event Args e) protected void gv Data_Row Updating(object sender, Grid View Update Event Args e) public int Updategv Data(In Log DTO b) ALTER PROCEDURE [dbo].[Updategv Data] @Logd In Username nvarchar(50) , @Comments nvarchar(50), @Btn ID int AS Update dbo.

Right now, I have not written code for the Update event. Right now, I have not written code for the Update event. Then the page posts back, the text boxes go back to being labels and the new values are lost, and the Row Updating code never fires.For a while now I’m trying to figure out why my method, triggered by the Grid View.Row Updating event, doesn’t work as all samples say it should do. Find Control("Text Box1"))); All this coded thing is not working. Used breakpoints and checked, its showing the same existing values which is there before editing. aspx code protected void Page_Load(object sender, Event Args e) public static User Principal Get User Principal(String user Name) protected void Get Year() protected void Get Month() public void Grd Get Comments() protected void Btn Save_Click(object sender, Event Args e) protected void gv Data_Row Editing(object sender, Grid View Edit Event Args e) protected void gv Data_Row Canceling Edit(object sender, Grid View Cancel Edit Event Args e) protected void gv Data_Row Updating(object sender, Grid View Update Event Args e) public int Updategv Data(In Log DTO b) ALTER PROCEDURE [dbo].[Updategv Data] @Logd In Username nvarchar(50) , @Comments nvarchar(50), @Btn ID int AS Update dbo.All samples of course assume you’re doing everything in your page, but I have to do everything in my code-behind, because on forehand I don’t know what I’ll be binding to my Grid View.