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

Open calendar when mouse is over the control.

3 Answers 80 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Karl Ranville
Top achievements
Rank 1
Karl Ranville asked on 03 Jul 2013, 04:06 AM
Hi guys,

I have a raddatepicker in my page and I want to open the calendar once the mouse is over the control textbox. So please help me with this.

Regards
Karl

3 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 03 Jul 2013, 06:02 AM
Hi Karl,

Please have a look at the sample code I tried which works fine at my end.

ASPX:
<telerik:RadDatePicker ID="RadDatePicker1" runat="server">
</telerik:RadDatePicker>

JavaScript:
<script type="text/javascript">
    function showCalenarpopup(e, pickerID) {
        var datePicker;
        if (pickerID == null) {
            datePicker = $find("<%= RadDatePicker1.ClientID %>");
        }
        else {
            datePicker = $find(pickerID);
        }
        datePicker.showPopup();
    }
</script>

C#:
protected void Page_Load(object sender, EventArgs e)
{
    RadDatePicker1.DateInput.Attributes.Add("onmouseover", "showCalenarpopup(event, '" + RadDatePicker1.ClientID + "');return false;");
}

Thanks,
Shinu.
0
Karl Ranville
Top achievements
Rank 1
answered on 04 Jul 2013, 09:00 AM
Hi shinu

Your code works pretty cool. I forget to mention that calendar should go when mouse is moved apart.
0
Shinu
Top achievements
Rank 2
answered on 04 Jul 2013, 09:54 AM
Hi Karl,

Please try the following code along with the other code used to show the popup calendar on mouse over.

JavaScript:
<script type="text/javascript">
    function hideCalenarpopup(e, pickerID) {
        var datePicker;
        if (pickerID == null) {
            datePicker = $find("<%= RadDatePicker1.ClientID %>");
        }
        else {
            datePicker = $find(pickerID);
        }
        datePicker.hidePopup();
    }

C#:
RadDatePicker1.DateInput.Attributes.Add("onmouseout", "hideCalenarpopup(event, '" + RadDatePicker1.ClientID + "');return false;");

Thanks,
Shinu.
Tags
Calendar
Asked by
Karl Ranville
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Karl Ranville
Top achievements
Rank 1
Share this question
or