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

RadDatePicker Client ID in a complex scenario

1 Answer 148 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Yash
Top achievements
Rank 1
Yash asked on 04 May 2011, 08:11 PM
Hi,
This is a complex scenario which I will try to explain as good as I can.
I have a Master Page(MasterPage1) and their is another MasterPage(MasterPage2) inherited from the MasterPage1.
So in MasterPage2, I have a RadDatePicker which is inside a RadPageView which is inside a RadPanelBar.

Now, i want the ClientID of this RadDatePicker. Presently I am trying it using $find(<%= id_radDatePicker.ClientID%>), which says that id_radDatePicker doesnt exist in the scenario.

I would appreciate if you can let me know how to get around with this.

regards
Yash

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 05 May 2011, 07:31 AM
Hello Yash,

One suggestion is to attach either DateInput-ClientEvents-OnLoad or Calendar-ClientEvents-OnLoad and which is having the default argument sender. With this sender you can extract the RadDatepickerID.
OnLoad
aspx:
<telerik:RadDatePicker EnableScreenBoundaryDetection="true" runat="server" Calendar-ClientEvents-OnLoad="OnLoad" ID="RadDatePicer1">
</telerik:RadDatePicker>

Javascript:
function OnLoad(sender)
   {
       sender.get_id();//you will get the ID of the Calender control which is embed in RadDatePicker. Now you can retrieve the ID by spiting the ID that we get
   }

Thanks,
Princy.
Tags
Calendar
Asked by
Yash
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or