This is a migrated thread and some comments may be shown as answers.
Problems to access items on edit template
1 Answer 28 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Simón asked on 05 Feb 2009, 06:31 PM
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

1 Answer, 1 is accepted

Sort by
Top achievements
Rank 1
answered on 06 Feb 2009, 08:24 AM
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

Asked by
Top achievements
Rank 1
Answers by
Top achievements
Rank 1
Share this question