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

[Solved] Problem regarding nestedviewtemplate and executing javascript functions client side

1 Answer 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Maria
Top achievements
Rank 1
Maria asked on 09 Nov 2009, 05:52 PM
Hello,
I've been trying to do something that has a problem.

I have a RadGrid with a nestedviewtemplate. Inside this newstedviewtemplate i have 3 tabs with another radgrid (1st tab), several control (2nd tab) and a repeater (3rd tab).

I've been trying by client side, when i change the values in the 2nd tab (several controls) I need to place a checkbox with checked=true. My problem has been trying to do this when changing the selected date in a RadDatePicker.

Mensagem: O objecto não suporta esta propriedade ou método
Linha: 6
Caráct: 29366
Código: 0
URL: http://localhost/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager2_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3apt-PT%3ad0c4ca6e-6b5d-49b6-922d-5244924fb100%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.2.826.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3apt-PT%3ad2d891f5-3533-469c-b9a2-ac7d16eb23ff%3ae330518b%3a16e4e7cd%3af7645509%3a24ee1bba%3a1e771326%3ac8618e41%3aaa288e2d%3aed16cbdc%3a58366029%3a874f8ea2%3a8bd1850e%3a50790754%3ac01e561a

The line of code of when I try to change the attributes in the server side (when executing the expandall command in the first radgrid) is this:

rDatePickerInicial.ClientEvents.OnDateSelected = "ChangeCheckBox('" + ckChanges.ClientID + "')";

The code for asp.net textbox is:
 

txtDescricaoPt.Attributes.Add(

"onkeypress", "javascript:ChangeCheckBox('" + ckChanges.ClientID + "')");

 txtDescricaoGb.Attributes.Add(

 

"onkeypress", "javascript:ChangeCheckBoxCheckBox('" + ckChanges.ClientID + "')");

 

 

and this works.

My only problem has to do with Telerik controls.

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 12 Nov 2009, 04:14 PM
Hello Maria,

The syntax you use for the OnDateSelected client event handler of RadDatePicker is not appropriate (it accepts only the name of the javascript method that will be executed when  you select a date in the picker).

Hence you need to assign it as follows:

rDatePickerInicial.ClientEvents.OnDateSelected = "ChangeCheckBox"

and locate the checkbox DOM element inside the corresponding ChangeCheckBox function. In case the checkbox resides in RadGrid template, utilize the technique presented here.

Best regards,
Sebastian
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
Maria
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or