This is a migrated thread and some comments may be shown as answers.

How to access controls in template column in Javascript

1 Answer 112 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jagat
Top achievements
Rank 1
Jagat asked on 27 Sep 2011, 11:58 PM
Hello,

  I am trying to access the controls( textbox and dropdown) in template columns in the javascript. The way i am doing is,,,
 var lat = '<%=txtComments.ClientID %>';
                   var lon  = '<%= ddlReason.ClientID %>';

But i am getting a error that those controls are not declared...

I am calling that javascript function like thiss

 <telerik:GridTemplateColumn HeaderText="Reason" UniqueName="Reason" Visible = "false">
        <EditItemTemplate>
          <asp:DropDownList ID="ddlReason" runat="server" ToolTip="Reason"   OnSelectedIndexChanged="NoShowReason(); return    false;" >
 </asp:DropDownList>
</EditItemTemplate>
   </telerik:GridTemplateColumn>

How do i do this????

Appreciate the help
Thanks

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 Sep 2011, 05:04 AM
Hello Jagat,

You can try the following code library approach to access the Template controls.
Accessing server controls in a grid template on the client.

Thanks,
Shinu.
Tags
Grid
Asked by
Jagat
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or