Problem: To call any javascript(Client Side) on click of UpdateButton or InsertButton of RadGrid like this image,
Solution: Here is the code
Protected Sub radGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles radGrid1.ItemDataBound
If (TypeOf e.Item Is GridEditableItem) AndAlso (e.Item.IsInEditMode) Then
Dim edititem As GridEditableItem = DirectCast(e.Item, GridEditableItem)
Dim BtnUpdate As LinkButton
If e.Item.OwnerTableView.IsItemInserted Then
BtnUpdate = DirectCast(edititem.FindControl("PerformInsertButton"), LinkButton)
Else
BtnUpdate = DirectCast(edititem.FindControl("UpdateButton"), LinkButton)
End If
BtnUpdate.Attributes.Add("OnClick", "return verify_form('form',0)")
End If
End Sub
Solution: Here is the code
Protected Sub radGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles radGrid1.ItemDataBound
If (TypeOf e.Item Is GridEditableItem) AndAlso (e.Item.IsInEditMode) Then
Dim edititem As GridEditableItem = DirectCast(e.Item, GridEditableItem)
Dim BtnUpdate As LinkButton
If e.Item.OwnerTableView.IsItemInserted Then
BtnUpdate = DirectCast(edititem.FindControl("PerformInsertButton"), LinkButton)
Else
BtnUpdate = DirectCast(edititem.FindControl("UpdateButton"), LinkButton)
End If
BtnUpdate.Attributes.Add("OnClick", "return verify_form('form',0)")
End If
End Sub
Here return verify_form('form',0) is the name of javascript function
No comments:
Post a Comment