Without seeing your markup, it's hard for me to tell if you've created .Although this isn't as big of a problem when you're referencing the text from web controls, getting in the habit now will prevent you from serious headaches and inefficiently checking for null and empty later. NET 4.0, you should have access to event, you need to pull the new values out of the front-end controls, and then re-bind your data. Add(New Data Column("Col1_ML", Get Type(String))) dt. Add(New Data Column("Col1_PH", Get Type(String))) dt. You didn't ask this in your question, but you've written some smelly code here.I'll try to address your question, but I'm also going through some of the other problems here.Here's some code that needs to retrieve a Pk of one of the bound items and then perform some work on the data (in this case the business object): This seems like a lot of code to have to write just to retrieve data context.
Dim dt = CType(Session("dt"), Data Table) 'Update the values.
You're accessing so many items without null checks that it could be any number of things. Are you sure all of the controls exist in the cells you're specifying?
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.
So I'm taking a few minutes - for my own sake - to write this stuff down so I can look it up next time I have a brain fart Using a Button Field you can specify a Command Name which in turn provides the On Row Command event some context as to what type of operation you are dealing with in Code Behind.
In Code Behind you have to do a bit of work though if you want to retrieve the proper context from a Data Item.