Rowupdating event vb
This means that when the user does an update, the data from that update is lost.
You should create your data source once (on the user's first visit) and store it into Session for later use, and only bind the Grid View to the data source when it is necessary to do so.
I would need to set values passed to the Sql Data Source control on the update event, and as part of this I would need to reference the controls contained in the row being updated.
To do this, I created an instance of the Row Updating event for the Grid View.
I am using a Template Field to display my Edit, Update and Cancel 'buttons' in the first column of the Grid View within respective Item Template and Edit Item Template fields.
Within the Item Template I have an Image Buttong with a Command Name of "Edit".
You have to make sure that you aren't setting your Grid View's data when it is not postback.
If you do this, your Grid View's source will be refreshed before you're able to grab the new values out of it.
I found that simple data binding of my Drop Down List in my Grid View to my Sql Data Source was not going to be enough. event is raised when a row's Update button is clicked, but before the Grid View control updates the row.