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

Calendar in ComboBox

1 Answer 75 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Raymond Mui
Top achievements
Rank 1
Raymond Mui asked on 06 May 2008, 09:47 AM
I tried to run the demo of the following page

http://www.telerik.com/demos/aspnet/prometheus/ComboBox/Examples/Default/DefaultCS.aspx

When I click the calendar navigation button to other months, the comboBox collapse and needed to be clicked again to show the calendar.  Besides, the comboBox text becomes a string of text.

It seems to be a limitation to use Calendar in ComboBox?!?

1 Answer, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 07 May 2008, 01:29 PM
Hi Raymond Mui,

I suggest you to wrap the calendar in a div as following:

<ItemTemplate> 
  <div id="div1">  
                        <telerik:RadCalendar ID="RadCalendar1" runat="server" TitleFormat="MMMM yyyy" Skin="Vista" style="margin: 0 auto;" 
                            ShowRowHeaders="false" OnSelectionChanged="Calendar_HouseTourDate_SelectionChanged" AutoPostBack="true" ClientEvents-OnDateClick="OnDateClick" ClientEvents-OnDateSelecting="OnDateSelecting" EnableMultiSelect="false" > 
                        </telerik:RadCalendar> 
 </div  
</ItemTemplate> 
 

Then you can hook click event of the div and stop propagation of browser event when the div is clicked. To do so you can just put the following code after RadComboBox definition.

 <script type="text/javascript">  
                var div1 = document.getElementById("div1");  
                div1.onclick = StopPropagation;  
 
        function StopPropagation(e)  
         {  
             if(!e)  
             {  
                 e = window.event;  
             }  
                   
             e.cancelBubble = true;  
         }          
 
 </script>  
 

Regards,
Rosi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Calendar
Asked by
Raymond Mui
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Share this question
or