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

Retrieve control in FormTemplate clientside

3 Answers 41 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Roman
Top achievements
Rank 1
Roman asked on 06 Jan 2010, 01:25 PM
Hi

I read through several similar problems to mine, however, I was unable to solve mine.
Aim is to client access the Object object (not the HTML dom object) of a RadListBox located in a RadGrid FromTemplate.

Here's the code so far
var listbox = $telerik.findControl(document.getElementById('<%= RadGrid1.ClientID %>'), "RadListBox1"); 
while the $telerik.findControl returns null.
Same issue with $find.

In the documentation "Accessing server controls in a grid template on the client" you only access the HTML DOM element which has no use if I want to manipulate the ListBox like in the RadGrid clientside examples.
I am no expert in JavaScript, please correct me if I'm wrong.

Thanks in advance for answers
Kind regards
Roman

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 1
answered on 06 Jan 2010, 02:01 PM
Hello Roman,

I tried the code you provided at my end and it retrieves the RadListBox client object. Make sure that the RadListBox is not hidden. Also check if the FormTemplate is open while accessing the ListBox.

-Princy.
0
Roman
Top achievements
Rank 1
answered on 06 Jan 2010, 02:10 PM
Hello Princy

Thanks for your answer.
My control hierarchy looks like this: RadGrid->EditFormSettings->FormTemplate->RadListBox. The RadListBox is not hidden and  the RadGrid is in edit mode. Unfortunately I am still not able to retrieve the control

Further information:
When looping through the $telerik.radControls the RadListBox is not in it.

Thanks again for the fast reply
Regards
Roman
0
Roman
Top achievements
Rank 1
answered on 06 Jan 2010, 02:14 PM
Hi again

I am quite confused, but somehow restarting the Visual Studio (and the IIS) solved the problem. Very weird indeed, but problem solved. Thank you and sorry for the inconvenience :)

Kind regards
Thanks and sorry again
Roman
Tags
Grid
Asked by
Roman
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Roman
Top achievements
Rank 1
Share this question
or