Problems to access items on edit template

2 posts, 0 answers
  1. Simón
    Simón avatar
    21 posts
    Member since:
    Dec 2008

    Posted 05 Feb 2009 Link to this post

    Hi, I need to access the components in the edit template of my grid in the Javascript. I saw the code below in a example in the forum, but it's not working for me. My Code:

    Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated
            If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
                Dim script As String

                Session("inEdit") = True
                rdcbTipo1 = CType(CType(e.Item, GridEditableItem).FindControl("rdcbTipoFonte1"), RadComboBox)
                rdcbTipo1.AutoPostBack = True
                script = "client_rdcbTipo1=" & rdcbTipo1.ClientID & ";\n"
                Page.ClientScript.RegisterStartupScript(Me.GetType, "clientID", script)
               
                >>>> I tried also : RadAjaxManager1.ResponseScripts.Add(script)
            End If
    End Sub

    I'm using a master page, where I put >>> var client_rdcbTipo1;

    In the javascript the client_rdcbTipo1 is undefined. Is there any problem with my code? How I could access the components of my edit template?

    Thanks in advance,

    Simón de Lizarza
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 06 Feb 2009 Link to this post

    Hello Simón,

    You can refer to the following code library submission which demonstrates on how to access controls in templates of grid on client. Probably this alternative may help you achieve your scenario.
    Accessing server controls in a grid template on the client

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