Default Saturday check in rad recurrence editor

10 posts, 0 answers
  1. deepti
    deepti avatar
    9 posts
    Member since:
    Jul 2011

    Posted 14 May 2012 Link to this post


    Hello,

    I am using rad recurrence editor in which Saturday checkbox is checked by default. In order to resolve this issue I used below script 

     string scriptToRegister = "$('.rsAdvWeekly_WeekDays input:checkbox').each(function (index) { $(this).attr('checked', false); });";
     ScriptManager.RegisterStartupScript(this, this.GetType(), "RecurranceKey", scriptToRegister, true);

    Using above script checkbox is getting unchecked but after that when I want to bind 'RecurrenceRuleText' to recurrence editor, it is not binding the rule properly. That means at the time of editing when I want Saturday checkbox as checked, so because above script it is unchecking the checkbox.

    Could you please assists me on this issue?

    Thanks and Regards,
    Deepti
  2. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 17 May 2012 Link to this post

    Hello Deepti,

    You could subscribe to the OnFormCreated client event and add the following code in it.
    var weekDays = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Suturday");
     
    function OnClientFormCreated(sender, args) {
        var mode = args.get_mode();
        if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert) {
            var selctedDate = sender.get_selectedDate();
            var day = weekDays[selctedDate.getDay()];
     
            $telerik.$('.rsAdvWeekly_WeekDays input').each(function (index, item) {
                var inputDay = item.name.split('WeeklyWeekDay')[1];
                if (inputDay == day) {
                    if (item.checked ) {
                        item.checked = false;
                    }
                }
            });
        
    <telerik:RadScheduler runat="server" ID="RadScheduler1" ShowFullTime="true" OnClientFormCreated="OnClientFormCreated">

    I hope this will help.

    Kind regards,
    Ivana
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. deepti
    deepti avatar
    9 posts
    Member since:
    Jul 2011

    Posted 26 Jun 2012 Link to this post

    Hi Ivana,

    Thanks for the reply. But I am using rad recurrence editor instead of rad scheduler. I think below function is used for rad scheduler. Could you please suggest any solution for recurrence editor?

    Thanks and Regards,
    Deepti
  5. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 27 Jun 2012 Link to this post

    Hi Deepti,

     
    You can use pageLoad function instead and uncheck the Saturday checkbox as in the code below where "RadSchedulerRecurrenceEditor1" is the id of RecurrenceEditor used:

    document.getElementById("RadSchedulerRecurrenceEditor1_WeeklyWeekDaySaturday").checked = false;

    Hope this will be helpful.

    Greetings,
    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Kalpna
    Kalpna avatar
    37 posts
    Member since:
    Jun 2013

    Posted 31 Mar 2014 Link to this post

    Hello all, The following above code is not working. I am using Advanced Form for insert and update the calendar activities. If i use OnClientFormCreated then the options of Add New Activity and Add Recurrence Activity is not working. When i select Add new Recurring activity then it will check the current day in Weekly recurrence. And if i select Add new activity and check the Recurrence Box then it will not check the current day in Weekly Recurrence, it will check Saturday. Please help me. It is urgent for me.
  7. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 02 Apr 2014 Link to this post

    Hi Kalpna,

    I have tested the described behavior both locally and on our on-line demos and it worked correctly in all cases and only the checkbox of the clicked day was checked. Would you please let us know if it can be replicated on any of our demos or share the code that is not working correctly s owe could be more helpful.

    Regards,
    Plamen
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  8. Kalpna
    Kalpna avatar
    37 posts
    Member since:
    Jun 2013

    Posted 07 Apr 2014 Link to this post

    Is there any way to check current day in weekly recurrence using c#??
    Please help me.
    I have tried many times but above code is not working. 
  9. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 07 Apr 2014 in reply to Kalpna Link to this post

    Hi Kalpna,

    The selected Date of the Radscheduler will return the Current Date only if you are not specifying any date as selected. Please have a look into the following code snippet which works fine at my end.

    ASPX:
    <telerik:RadScheduler runat="server" ID="RadScheduler1"
        SelectedView="WeekView" ...>
      ...
    </telerik:RadScheduler>
    <telerik:RadButton ID="RadButton1" runat="server" Text="Current Date" OnClick="RadButton1_Click">
    </telerik:RadButton>

    C#:
    protected void RadButton1_Click(object sender, EventArgs e)
    {
        string currentdate = RadScheduler1.SelectedDate.ToString();
    }

    Thanks,
    Shinu.
  10. Kalpna
    Kalpna avatar
    37 posts
    Member since:
    Jun 2013

    Posted 07 Apr 2014 in reply to Shinu Link to this post

    Hii Shinu,
    this is not what i want.
    I want to check the current day in Radschedular RecurrenceEditor. I am able to get the day of appointment day. But recurrence editor does not check the current day on Add New Appointment.
    If i use Add new Recurring appointment then it will check the current day but in case of Add new appointment, it will not.

    Thanks
  11. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 08 Apr 2014 Link to this post

    Hi,

    You can check or uncheck some of the checkboxes in the recurrence editor in FormCreated event as for example it is described in this Handling FormCreated help topic in the Make changes in the recurrence editor paragraph.

    Hope this will be helpful.

    Regards,
    Plamen
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017