This is a migrated thread and some comments may be shown as answers.

ItemUpdating get ONLY changed values

2 Answers 33 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
SDI
Top achievements
Rank 1
SDI asked on 21 Jan 2019, 06:39 PM

I can get the oldValues, newValues, but i can not get JUST the changed values on server-side ItemUpdating event. Why is that? The data tier is waiting for an object with fields and values that need to be updated on a given primary key. I want to send 2 items in the hashtable, not 100 items of useless data to be updated, when i only have 1 item that needs to be updated in the database. Please tell me that you have this functionality? I tried to use the UpdateValues, but its always empty, but it seems different than SavedOldValues and ExtractValues. Why use "UpdateValues" if it doesnt do the same, confusing to say the least.

The help in the demos is not what we are doing. This is one record placed in edit-mode when the dataform loads. Again there should only be a few lines to send the hashtable to the data tier. 

 

            Dim editedItem As RadDataFormEditableItem = TryCast(e.DataFormItem, RadDataFormEditableItem)
            Dim oldValuesHT As Hashtable = editedItem.SavedOldValues()
            Dim newValuesHT As New Hashtable()
            Dim updatedValuesHT As New Hashtable()
            editedItem.ExtractValues(newValuesHT)
            editedItem.UpdateValues(updatedValuesHT)

 

Any help Telerik?

2 Answers, 1 is accepted

Sort by
0
SDI
Top achievements
Rank 1
answered on 09 Feb 2019, 05:11 PM
Your support is impeccable!
0
SDI
Top achievements
Rank 1
answered on 08 Mar 2019, 01:29 PM

Another month - what takes you guys so long to reply.

Another issue is on bind the hashtable has a "nothing" value for a RadTextBox that is empty. Why not a string value? This causes problems when sending it to the data tier as nothing, instead of string.empty. You obviously cant loop through the hashtable to update values, so it needs hardcoded for each check. This is crazy.

<telerik:RadTextBox runat="server" ID="RadTextBoxExtension" Width="100%" Text='<%# Bind("Extension") %>'/>

 

I have to do this when the user clears the field for RadTextBoxExtension. Why not set it to String.Empty in the extracted values? Is there something that needs set to avoid this?

RadListViewEditableItem.ExtractValues(Hashtable)
 
If String.IsNullOrEmpty(Hashtable("Extension")) Or IsNothing(Hashtable("Extension")) Then
     Hashtable("Extension") = String.Empty
End If

 

 

Tags
DataForm
Asked by
SDI
Top achievements
Rank 1
Answers by
SDI
Top achievements
Rank 1
Share this question
or