Multiple templates for different item commands?

2 posts, 0 answers
  1. Saad
    Saad avatar
    82 posts
    Member since:
    Oct 2008

    Posted 04 Jan 2009 Link to this post

    i just need to have more than one templates in my radGrid. I have made a context menu which will be shown on right click over each row. Context menu have three options, delete, forward and noteback. I just want three different kinds of editing mode or template columns for each of the option which will have different controls.
    Please guide me in it.....
    And it would be better if the process of showing these templates will be at client side. 
    Thank you!
  2. Phil
    Phil avatar
    273 posts
    Member since:
    Jul 2008

    Posted 04 Jan 2009 Link to this post

    This might be a start, I have supplied a lot more than telerik:

    Protected Sub RagGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RagGrid1.ItemCommand
        If (e.CommandName = RadGrid.InitInsertCommandName) Then
            e.Canceled = True
            e.Item.OwnerTableView.EditFormSettings.EditFormType = GridEditFormType.WebUserControl
            e.Item.OwnerTableView.EditFormSettings.UserControlName = "~/uc/InvoiceAdd.ascx"
            Dim _insertItem As GridEditableItem = e.Item.OwnerTableView.GetInsertItem()
            If Not _insertItem Is Nothing Then
                Dim _addControl As UserControl = CType(_insertItem.FindControl(GridEditFormInsertItem.EditFormUserControlID), UserControl)
                If Not _addControl Is Nothing Then
                    CType(_addControl, IAdd).Clear() ' need to bind, using interface
                End If
            End If
        ElseIf (e.CommandName = RadGrid.EditCommandName) Then
            e.Item.OwnerTableView.EditFormSettings.EditFormType = GridEditFormType.AutoGenerated
            e.Item.OwnerTableView.IsItemInserted = False
        End If
    End Sub

    to convert to C# use

    Good luck Saadi

Back to Top