Problem in Delete break and block in weekly view

6 posts, 0 answers
  1. Jiten
    Jiten avatar
    67 posts
    Member since:
    Dec 2010

    Posted 24 Feb 2012 Link to this post

    Hello,

    I have a problem regarding the scheduler. I have bind the break data using in calender(see the attachment file which content data of break or block). In weekly view, i want to delete particular date from the calender. I used the (e.Appointment.Start.Date) or RadScheduler1.SelectedDate  to find the date. It is not delete the selected break or block date.

    But no problem in day view. It is delete the selected date. But the problem in weekly view. In weekly view, RadScheduler1.SelectedDate not work because it only delete the today date.

    Please help me as soon as possible

    Thanks

    Jiten Mutum
  2. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 28 Feb 2012 Link to this post

    Hi Jiten,

    It seems that the image is not attached correctly.

    You can refer to the Setting Special days or time slots in RadScheduler KB article that describes similar functionality. 

    Hope this will be helpful. 

    Kind regards,
    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.
  3. Jiten
    Jiten avatar
    67 posts
    Member since:
    Dec 2010

    Posted 29 Feb 2012 Link to this post

    Hello Plamen Zdravkov,

    I only Click on the Break or Block time slot in the calender and want to delete from the calender.
    You are talking about different way. I only want to delete the Break time slot that all.
    You can see the different date in the table(Attachment File). But when I click on the particular date in the weekly view it is not delete the selected date. That is the problem but day view has no problem.

    And I used this event:
    protected void RadScheduler1_AppointmentContextMenuItemClicked(object sender, AppointmentContextMenuItemClickedEventArgs e)
        {
     if (e.MenuItem.Value == "Delete")
            {
    //First Way
                DateTime todayDate = e.Appointment.Start.Date;
    //Second Way
    DateTime todayDate = RadScheduler1.SelectedDate;
                string date = todayDate.ToShortDateString();
    }
    }

    I want the selected date.

    And In aspx page, added menu for delete:
     <AppointmentContextMenus>
      <telerik:RadSchedulerContextMenu runat="server" DataTextField="Status" DataValueField="StatusId"
      ID="SchedulerAppointmentContextMenu" AppendDataBoundItems="true">
     <Items>
     <telerik:RadMenuItem Text="Delete" Value="Delete" />
    </Items>
     </telerik:RadSchedulerContextMenu>
    I attach a new image file regarding this problem. Please see.

    And help as soon as possible.

    Thanks
    Jiten
  4. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 02 Mar 2012 Link to this post

    Hello Jiten,

     
    I have tested the behavior at our online demo,  but could not observe any unusual behavior. You can see a video as part of our local tests. 

    If your scenario is somehow different, please try to explain how to reproduce it step by step.

    Kind regards,
    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.
  5. Jiten
    Jiten avatar
    67 posts
    Member since:
    Dec 2010

    Posted 06 Mar 2012 Link to this post

    Hello Plamen Zdravkov,
    I see your video, but you are displaying the different appointment which can delete in our server database also.

    But the break time slot is different from the appointment time slot. Please create one month break time for particular doctor, so it will display particular time slot (example 4 pm to 5 pm) and display for that month.
    And that break or Block data come from database and that data can see attachment which I already attached.
    And ID of that Break or Block is same and one row in the table for that break.
    For displaying  in the calender I created cursor to display that break or block for month.

    And I used this event:
    protected void RadScheduler1_AppointmentContextMenuItemClicked(object sender, AppointmentContextMenuItemClickedEventArgs e)
        {
     if (e.MenuItem.Value == "Delete")
            {
    //First Way
                DateTime todayDate = e.Appointment.Start.Date;(This is getting selected date from the weekly view, it getting the today date)
    //Second Way
    DateTime todayDate = RadScheduler1.SelectedDate;(This is getting selected date from the weekly view, it getting the today date)
                string date = todayDate.ToShortDateString();
    }
    }

    I want the selected date.

    And In aspx page, added menu for delete:

     <AppointmentContextMenus>
      <telerik:RadSchedulerContextMenu runat="server" DataTextField="Status" DataValueField="StatusId"
      ID="SchedulerAppointmentContextMenu" AppendDataBoundItems="true">
     <Items>
     <telerik:RadMenuItem Text="Delete" Value="Delete" />
    </Items>
     </telerik:RadSchedulerContextMenu>

    I give the above information in details.
    I think you can understand what I want to tell you.

    Thanks

    Jiten


  6. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 09 Mar 2012 Link to this post

    Hi Jiteni,

    Here is one way how you can get the first day of the selected week and the last day of the selected week when you click the context menu of the appointment:

    protected void RadScheduler1_AppointmentContextMenuItemClicked(object sender, AppointmentContextMenuItemClickedEventArgs e)
           {
                   DateTime todayDate = e.Appointment.Start.Date;//(This is getting selected date from the weekly view, it getting the today date)
                   DateTime lastDayoftheSelectedweek = selectedTime.AddDays(6);
           }
           DateTime selectedTime = new DateTime();
           int counter = 0;
           protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
                       if (RadScheduler1.SelectedView==SchedulerViewType.WeekView)
               {
                   if (counter==0)
                   {
                       selectedTime = e.TimeSlot.Start.Date.AddDays(1);
                       counter++;
                   }
               }
           }

    Hope this will be helpful.

    Kind regards,
    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.
Back to Top