New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
Include Additional Action Button
There are scenarios in which you may want to include additional button right after your edit form Update/Cancel buttons. To do that, you can wire the ItemDataBound event of the grid and add a custom button to the GridEditCommandColumn for the respective table.In addition, you can attach a confirmation dialog to its onclick attribute to display notification for the user when he clicks that button.Here are two example which illustrate that (note that you should add code to delete the item manually or use automatic deletes feature).
InPlace edit mode:
ASP.NET
<telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" runat="server">
<MasterTableView EditMode="InPlace">
<Columns>
<telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
</telerik:GridEditCommandColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
Auto-generated edit forms (MasterTableView EditMode="EditForms"):
VB
Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs)
If TypeOf e.Item Is Telerik.Web.UI.GridEditFormItem AndAlso e.Item.IsInEditMode Then
Dim linkButton As New LinkButton()
linkButton.Text = "Delete"
linkButton.CommandName = "Delete"
linkButton.Attributes("onclick") = "javascript:return confirm('Do you want to delete this item?')"
Dim cancel As LinkButton = TryCast(e.Item.FindControl("CancelButton"), LinkButton)
cancel.Parent.Controls.Add(New LiteralControl(" "))
cancel.Parent.Controls.Add(linkButton)
End If
End Sub