New Values("brief_Descrip")) = "" Then update Description = "" Else update Description = e. To String() End If Dim update Key As Integer = row. Text If update Description = "" Or update Description = "Null" Then update Description = "Null" End If I am guessing you are Data Binding in code-behind. (Or possibly one that implements IData Source.) If so, examine the Row (use Find Control if possible) to get the Controls holding the edited values from the Cells. However, you can also examine the Cells of the Row. You could even loop over the Cells and use Extract Values on each into the same Dictionary.
Text = my Text1 Dim update Description As String new Brief Descrip = row. If that is "brief_Descrip", you can use the Extract Data From Cell method of the Data Control Field on the Cell to get the value. Update Command = "usp_update PTTroot String" ' Call stored procedure Dim rows Affected As Integer = 0 Try rows Affected = item Data Source. Containing Field, Bound Field) Dim values As New Ordered Dictionary() field1Field. You will then have a Dictionary with all values in it. And no cast will be needed, as Containing Field already is of that type. When all you've got is a Hammer, Every Problem looks like a Nail. Okay, I am sorry that I am jumping around trying to work this out. I am not sure which direction you are suggesting I go here.
If that is a Bound Field, cast to that and you will have access to the Data Field property. Cells(6), Data Control Field Cell) Dim field1Field As Bound Field = Direct Cast(field1Cell. If you use Template Fields, you should go for the Extract Values method, and extract the values from each Cell. This can be beneficial to other community members reading the thread.
Grid View (and some others) won't play nice when doing that. If it is a Data Control Field Cell, cast to that and get its Containing Field. Text = "Database was not updated for record " & row. Text + ", string text " + update String + "." End If Catch ex As Exception Throw ex End Try Dim field1Cell As Data Control Field Cell = Direct Cast(row. You will then get a Dictionary with all values, with the field names as keys. In the Row Updating handler, you will need to extract the values like I do in my Updating handler. Template Fields are not Bound Fields, and they don't have Data Field on them. Please remember to click “Mark as Answer” on the post that helps you.
The hashtable contains former values of the row's cells.
If the grid contains templated columns or is bound to some of the fields from the data source, the Values and Old Values must be updated to add those missing values.
Otherwise missing cells will be nulled out by the auto update operation. The dictionary consists of the new values to be set on the row's unbound cells.
The hash key is the key of corresponding column and the value is the new value to be set.
If the values are alternated in the dictionary they are applied to the grid. The hashtable consists of the new values to be set on the row cells.
If the values are alternated in the hashtable they are applied to the grid and carried over to the data source as well.