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

    Hi,
    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:

    http://www.telerik.com/help/aspnet/grid/grddifferenteditformsoneditandinsert.html

    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
            RagGrid1.EditIndexes.Clear()
            e.Item.OwnerTableView.EditFormSettings.EditFormType = GridEditFormType.WebUserControl
            e.Item.OwnerTableView.EditFormSettings.UserControlName = "~/uc/InvoiceAdd.ascx"
            e.Item.OwnerTableView.InsertItem()
            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 http://converter.telerik.com/

    Good luck Saadi

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top