Rad Date Picker Multiple Date Select

9 posts, 0 answers
  1. The KID
    The KID avatar
    24 posts
    Member since:
    May 2008

    Posted 28 Aug 2008 Link to this post

    Hi

    I want to use the Date picker for multiple date selection. I've seen it on the calendar but couldn't find it on the date picker. My plan is to be able to take the multiple dates stored the string of dates as a delimited string and then also be able to return the string and bind it back to date picker from that delimited string.

    Help?

    --Mike
  2. Plamen Peshev
    Admin
    Plamen Peshev avatar
    886 posts

    Posted 29 Aug 2008 Link to this post

    Hello Mike,

    Actually,  RadDatePicker does not support selection of multiple dates at the same time.

    Kind regards,
    Plamen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. The KID
    The KID avatar
    24 posts
    Member since:
    May 2008

    Posted 29 Aug 2008 Link to this post

    That's unfortunate. So if i use the calendar, what would be be the best way going about storing the multiple dates so I could go back and bind them back to the calendar?
  5. John
    John avatar
    416 posts
    Member since:
    Oct 2006

    Posted 01 Sep 2008 Link to this post

    hi


    You can use RadCalendar control instead of RadDatePicker. Review the following online demo:

    http://demos.telerik.com/aspnet/prometheus/Calendar/Examples/Functionality/MultiDaySelection/DefaultCS.aspx


    Regards...
    <John:Peel />
  6. amith
    amith avatar
    7 posts
    Member since:
    Jun 2008

    Posted 08 May 2009 Link to this post

    Hi ,

    In this case if i select multiple dates from the calendar and the have a button and text box, and on click of button i need all the dates selected in the calender to get populated in text box as comma separated values. So how can i do all these on client side?
  7. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 08 May 2009 Link to this post

    Hi Amit,

    Try the following client side code for achieving the functionality.

    aspx
     
    <telerik:RadCalendar ID="RadCalendar1" runat="server" Font-Names="Arial, Verdana, Tahoma">  
    </telerik:RadCalendar> 
     
    <input id="Button1" type="button" value="button" onclick="getSelected();" />   
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 

    javascript
     
    <script type="text/javascript">  
    function getSelected()  
    {  
        var d, text='';  
        var calendar = $find("<%= RadCalendar1.ClientID %>");  
        var dates = calendar.get_selectedDates();  
        for  (var i = 0; i < dates.length; i++)  
        {  
             var date = dates[i];  
             d= date[1] + '/' + date[2] + '/' + date[0];  
               
             if(i==dates.length-1)  
             {  
                text = text+ d;  
             }  
             else 
             {  
                text = d+ ',' + text;   
             }       
        }  
        var textbox = document.getElementById('TextBox1');  
        textbox.value = text;      
    }  
    </script> 

    Thanks,
    Princy.
  8. amith
    amith avatar
    7 posts
    Member since:
    Jun 2008

    Posted 08 May 2009 Link to this post

    Hi,

    Thanks for the quick reply. It worked the way i wanted.

    Thanks a lot.
  9. vaibhav
    vaibhav avatar
    8 posts
    Member since:
    Oct 2010

    Posted 20 Nov 2010 Link to this post

    Where i have found get_selectedDates(); function
    as i am getting error in calendar.get_selectedDates();  function.

    Please help me..Its Urgent....
  10. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 22 Nov 2010 Link to this post

    Hello vaibhav,

    get_selectedDates() is client-side JavaScript function for the calendar client object.

    If you want to get selected date server side from asp's code-behind use SelectedDate property of the RadCalendar.
    DateTime selectedDate = myCalendar.SelectedDate;
    where myCalendar is the ID of your calendar.

    Best wishes,
    Vasil
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017