Gridview rowupdating commandfield

by  |  22-Aug-2017 03:11

-Frinny @Frinavale The event is fired between load view state & save view state when the event is fired it set the values in textbox or whatever server control we used. Then there is no matter of data loss if you load the page again but I have to bind data in a grid view through view state on page load no chance of data loss. NET Page Life Cycle for a more detailed explination. Data Bind in the Page Load event (without checking if it's postback) then you will not be able to retrieve user input in the Grid View. -Frinny The View State is stored some time in between the Page Pre Render event and the Save State Complete event (heading towards the Render stage).All of this is covered in the article I sent you a link to :) I'm not sure what you mean by: @Frinavale Now i implemented the editing in gridview i handle events & after that i call display method in which i bind the grid view on page load event its work correctly.......When this event fired it saves the values at their view state & this view state is sent to the client. NET controls used to access the data in your C#/VB. If you do a Data Bind in the Page Load event then all of this data is lost!

gridview rowupdating commandfield-19gridview rowupdating commandfield-34

Ok the reason why you aren't losing data is because you are only doing your Data Bind in your Page Load event the first time the page is loaded (if ! This way your data is not getting over written when the user-provided-edit-data is posted back to the server.

But do you notice how you are calling the display() method in several different places?

I want to use this method so I can do an update in grid view directly. Grid Views can bind to Data Tables, Data Views, Arrays of Objects ..more.

I've never actually used the Sql Data Source before. So, you need to populate the object that you are going to use as your data source at some point in your page life cycle.

I'm not sure what you're stuck on so if you provide more information I can give you more help on the topic.

Community Discussion