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

[Solved] Get Control using javascript

3 Answers 141 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Balagangadharan R
Top achievements
Rank 1
Balagangadharan R asked on 28 Dec 2009, 06:54 AM
Dear All

i have a radgrid, with item templates . i need to get the control in item template using javascript.

Thanks in Advance.

Regards
Balagangadharan.R

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 28 Dec 2009, 07:52 AM
Hello Balagangadharan,

I hope the code library will help you in accessing the server controls placed in ItemTemplate of RadGrid.
Accessing server controls in a grid template on the client

There are two approaches described in the above code library:

  • Have a global registry (an array really) that keeps control ID's and emit script for every server control that will add an item to the global registry.  Then loop over all registered elements and get the one that contains the server ID.

  • Get all elements of a given tag name and try to find the one whose ID contains the server ID.


Hope this helps,
Princy.
0
Balagangadharan R
Top achievements
Rank 1
answered on 28 Dec 2009, 09:59 AM
hello Princy

Thanks for replying.

I used the code Library script, but it throws error as registeredElements is Undefined
0
Dimo
Telerik team
answered on 28 Dec 2009, 03:02 PM
Hello Balagangadharan,

Make sure that you have declared registeredElements as a global Javascript variable, as demonstrated in the code library example. The variable should be registered before the RadGrid control declaration.

If you still have problems, send us a complete runnable demo. Thanks.

Kind regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Balagangadharan R
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Balagangadharan R
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or