Hi,
My program logic is as below:
(1).Information in RadGrid is all show in label.
(2).User click on the Edit Icon which has CommandName= "Edit".
(3). GirdView turn into Edit Mode and user key in the information in the textBox.
(4)User click on the Update icon which has CommandName ="Update" and then fire UpdateCommand event.
My problem is in the UpdateCommand Event , i am not able to get the information that has been edited by user.I can only get information that is as before edited.
The purpose to have UpdateCommand event fire is to have checking and perform update action.
Does any one has idea on this?
My Coding is as below:
[code]
Protected Sub ajaxGridPlant_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles ajaxGridPlant.UpdateCommand
Dim strCompanyNo As String
Dim strPlantName As String
Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
Dim strPlantNo As String
Dim strLastModifiedBy As String
Dim dteLastModifiedOn As DateTime
Try
strCompanyNo = CType(editedItem.FindControl("ddlCompanyNo"), RadComboBox).SelectedItem.Value
strPlantNo = CType(editedItem.FindControl("txtPlant"), TextBox).Text
strPlantName = CType(editedItem.FindControl("txtPlantName"), TextBox).Text
strLastModifiedBy = CType(editedItem.FindControl("lblEditLastModifiedBy"), Label).Text
dteLastModifiedOn = CType(editedItem.FindControl("lblEditLastModifiedOn"), Label).Text
If strPlantNo = "" Then
Throw New Exception("OMG!!")
End If
'UpdateRecord(strCompanyNo, strPlantNo, strPlantName, strLastModifiedBy, dteLastModifiedOn)
Catch ex As Exception
Alert(ex.Message)
End Try
[/code]
My program logic is as below:
(1).Information in RadGrid is all show in label.
(2).User click on the Edit Icon which has CommandName= "Edit".
(3). GirdView turn into Edit Mode and user key in the information in the textBox.
(4)User click on the Update icon which has CommandName ="Update" and then fire UpdateCommand event.
My problem is in the UpdateCommand Event , i am not able to get the information that has been edited by user.I can only get information that is as before edited.
The purpose to have UpdateCommand event fire is to have checking and perform update action.
Does any one has idea on this?
My Coding is as below:
[code]
Protected Sub ajaxGridPlant_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles ajaxGridPlant.UpdateCommand
Dim strCompanyNo As String
Dim strPlantName As String
Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
Dim strPlantNo As String
Dim strLastModifiedBy As String
Dim dteLastModifiedOn As DateTime
Try
strCompanyNo = CType(editedItem.FindControl("ddlCompanyNo"), RadComboBox).SelectedItem.Value
strPlantNo = CType(editedItem.FindControl("txtPlant"), TextBox).Text
strPlantName = CType(editedItem.FindControl("txtPlantName"), TextBox).Text
strLastModifiedBy = CType(editedItem.FindControl("lblEditLastModifiedBy"), Label).Text
dteLastModifiedOn = CType(editedItem.FindControl("lblEditLastModifiedOn"), Label).Text
If strPlantNo = "" Then
Throw New Exception("OMG!!")
End If
'UpdateRecord(strCompanyNo, strPlantNo, strPlantName, strLastModifiedBy, dteLastModifiedOn)
Catch ex As Exception
Alert(ex.Message)
End Try
[/code]