Gridview rowupdating newvalues example
Notice that the programing is not running the event Row Updated any help?
Close() End If End Sub the problem is that the event row Updating is returning the old values so how can i get the new values for the update?
Last Change: More Information (@jwiscarson) I’m sorry, I was in hurry. In that project, the users could select 2 categories, enter a search string and the result will show in a Grid View. Here is my problem, if the "admin user" click on edit, change the value of the cell and execute the update, the value would not changed in the Hoo boy.
You didn't ask this in your question, but you've written some smelly code here.
The column depense on the selected value from the dropdown, I dont know the both selected items at the beginning.
Protected Sub Grid View1_Row Updating(By Val sender As Object, By Val e As Grid View Update Event Args) Handles Grid View1.
Find Control("lbl ID") Dim txt Course Name As Text Box = updating Row. Use the New Values property (dictionary) to access the values of the revised non-key fields in the row to update.
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 update operation, whenever this event occurs.
The difference between your code and the code on MSDN is: - The MSDN code takes the new data from the edited row and updates the appropriate data in the To me, this is garbage, because it's so highly coupled to the order of your cells.
If I had written the code, I would explicitly create all the front-end controls and use a binding command (if you aren't familiar, it looks like How should I create all front-end controls in the markup?