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

[Solved] open calendar on select changed

4 Answers 84 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
nirmal
Top achievements
Rank 1
nirmal asked on 22 Aug 2009, 10:18 AM
I am trying to open a calender present in a rad date picker control. When the drop down index of a dropdown is changed, I want to open the calendar pop up. I am exploring both the server side and client side events and methods to see which would suit my application the best. Can anyone tell me what are the methods/properties present in the raddate picker so as to open the pop up

Thanks 
Nirmal

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 24 Aug 2009, 05:23 AM
Hi Nirmal,

You could use the showPopup() clientside method of RadDatePicker in order to show the popup when the dropdown selection is changed. See the example.

ASPX:
 
<telerik:RadComboBox ID="RadComboBox1" runat="server" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged">  
    <Items> 
     . . .  
    </Items> 
</telerik:RadComboBox> 
<telerik:RadDatePicker ID="RadDatePicker1" runat="server">  
</telerik:RadDatePicker> 

JavaScript:
 
<script type="text/javascript">  
function OnClientSelectedIndexChanged()  
{  
    var datepicker = $find("<%= RadDatePicker1.ClientID %>");  
    datepicker.showPopup();  
}  
</script> 

Also checkout the following link to know more about most important methods of the RadDatePicker client-side object.
RadDatePicker Client Object

Thanks,
Princy.
0
nirmal
Top achievements
Rank 1
answered on 24 Aug 2009, 09:13 AM
Hi Princy...thanks for the response. however i wanted to do the same from server side. Is there anyway I can achieve this ?
0
Martin
Telerik team
answered on 24 Aug 2009, 01:49 PM
Hello Nirmal,

Unfortunately you can not set the calendar popup to be open on the server out of the box. However you can register a client script that will be sent to the browser. There you can make the calendar popup open like this:

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) 
    { 
            ScriptManager.RegisterStartupScript(ScriptManager1, typeof(Page), "MyScript""function pageLoad(){var datepicker = $find('RadDatePicker1');datepicker.showPopup()};"true); 
    } 

I hope this helps.

Regards,
Martin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
nirmal
Top achievements
Rank 1
answered on 25 Aug 2009, 07:25 AM
Hey Martin,

Thankyou very much for the post.
Tags
General Discussions
Asked by
nirmal
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
nirmal
Top achievements
Rank 1
Martin
Telerik team
Share this question
or