I've been searching your forums and reading documentation for several days now but have been unable to figure out how to access an updated item in my RadGrid.
Basically, I have a RadGrid with a Client Event where OnCommand is set to "RaiseCommand".
In my JavaScript RaiseCommand function, I am able to determine the command that was raised. When the command raised is "Update" I am calling ValidateInput function, passing along the sender and eventArgs that was passed to the RaiseCommand function.
Inside ValidateInput, I need to access updated values and do some edits to ensure the new values meet specific requirements. However I have been unable to figure out how to access the new values.
So I thought I'd try accessing the new values in my codebehind. I thought that if I could figure out how to do it there, I could use the same method in my javascript. I created subroutines that handle EditCommand, and UpdateCommand.
Inside my subroutine for EditCommand, I have been able to find and display in a message box, the values in the row where Edit was clicked.
When I execute my web page, after clicking Edit on a row in my RadGrid, I then modify the contents of one of the four fields. I then click on Update and my subroutine for UpdateCommand is invoked. Inside this subroutine, I have been able to succesfully find and display the SavedOldValues. However, I am unable to find the new value that I entered into one of the fields.
Here's some of my code:
After I click on Update, my UpdateCommand handler fires, and I see message boxes containing the four saved old values. But the following messages boxes (2 sets of 8) all display  .
I know there must something fundamental that I'm missing, but for the life of me, I've been unable to figure it out.
Please tell me how I can access the updated values in my codebehind, and then also in javascript.
Thanks!
Basically, I have a RadGrid with a Client Event where OnCommand is set to "RaiseCommand".
In my JavaScript RaiseCommand function, I am able to determine the command that was raised. When the command raised is "Update" I am calling ValidateInput function, passing along the sender and eventArgs that was passed to the RaiseCommand function.
Inside ValidateInput, I need to access updated values and do some edits to ensure the new values meet specific requirements. However I have been unable to figure out how to access the new values.
So I thought I'd try accessing the new values in my codebehind. I thought that if I could figure out how to do it there, I could use the same method in my javascript. I created subroutines that handle EditCommand, and UpdateCommand.
Inside my subroutine for EditCommand, I have been able to find and display in a message box, the values in the row where Edit was clicked.
When I execute my web page, after clicking Edit on a row in my RadGrid, I then modify the contents of one of the four fields. I then click on Update and my subroutine for UpdateCommand is invoked. Inside this subroutine, I have been able to succesfully find and display the SavedOldValues. However, I am unable to find the new value that I entered into one of the fields.
Here's some of my code:
<
telerik:RadGrid
ID
=
"rgUsers"
runat
=
"server"
BorderWidth
=
"1"
BorderColor
=
"#EBAB00"
AutoGenerateColumns
=
"false"
AllowSorting
=
"true"
>
<
ClientSettings
>
<
ClientEvents
OnCommand
=
"RaiseCommand"
/>
</
ClientSettings
>
<
ItemStyle
Font-Size
=
"10pt"
Font-Names
=
"Sans-serif"
/>
<
HeaderStyle
Font-Size
=
"12pt"
Font-Names
=
"Sans-serif"
/>
<
MasterTableView
EditMode
=
"InPlace"
>
<
Columns
>
<
telerik:GridBoundColumn
UniqueName
=
"UserId"
DataField
=
"UserId"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"username"
DataField
=
"username"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"level"
DataField
=
"level"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"subcatid"
DataField
=
"subcatid"
></
telerik:GridBoundColumn
>
<
telerik:GridEditCommandColumn
></
telerik:GridEditCommandColumn
>
<
telerik:GridClientDeleteColumn
ConfirmText="Are you sure you want to delete this user?></
telerik:GridClientDeleteColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Private Sub rgUsers_EditCommand(ByVal sender As Object, ByVal e As
Telerik.Web.UI.GridCommandEventArgs) Handles rgUsers.EditCommand
Dim gdi As GridDataItem = CType(e.Item, GridDataItem)
Dim UserId As String
Dim UserName As String
Dim Level As Integer
Dim SubCategoryID As Integer
UserId = gdi.Item("UserId").Text
UserName = gdi.Item("username").Text
Level = CType(gdi.Item("level").Text, Integer)
SubCategoryID = CType(gdi.Item("subcatid").Text, Integer)
MsgBox("EditCommand on " & UserId & " " & UserName & " " & Level.ToString & " " & SubCategoryID.ToString)
End Sub
Private Sub rgUsers_UpdateCommand(ByVal sender As Object, ByVal e As
Telerik.Web.UI.GridCommandEventArgs) Handles rgUsers.UpdateCommand
Dim rg As RadGrid = CType(sender, RadGrid)
Dim gdie As GridDataItem = CType(e.Item, GridDataItem)
Dim UpdatedRow As Integer = gdie.ItemIndex
Dim MasterTable As GridTableView = rg.MasterTableView
Dim gdim As GridDataItem = MasterTable.Items(UpdatedRow)
Dim cell As TableCell
Dim i As Integer
MsgBox(gdim.SavedOldValues("UserId").ToString)
MsgBox(gdim.SavedOldValues("username").ToString)
MsgBox(gdim.SavedOldValues("level").ToString)
MsgBox(gdim.SavedOldValues("subcatid").ToString)
i = 0
For Each cell In gdie.Cells
MsgBox(i.ToString & " " & cell.Text)
i += 1
Next
i = 0
For Each cell In gdim.Cells
MsgBox(i.ToString & " " & cell.Text)
i += 1
Next
End Sub
After I click on Update, my UpdateCommand handler fires, and I see message boxes containing the four saved old values. But the following messages boxes (2 sets of 8) all display  .
I know there must something fundamental that I'm missing, but for the life of me, I've been unable to figure it out.
Please tell me how I can access the updated values in my codebehind, and then also in javascript.
Thanks!