Please help me to find out the Break mechanism of Radschedular

20 posts, 2 answers
  1. imran
    imran avatar
    20 posts
    Member since:
    Oct 2010

    Posted 08 Dec 2010 Link to this post

    Please help to findout out the break mechanism of rad schedular..what i want is when a person have schedules break from 1 to 2(1 hr) then this time slot is not editable or Appointment...
  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 08 Dec 2010 Link to this post

    Hello Imran, 

    Have a look at this forum post.. I know it's about disabling past slots, rather than the slots you want to disable but the principal is the same.

    Sadly at the moment, the RadScheduler for WinForms doesn't support disabling cells. As per the forum post you'd need to catch when the EditAppointmentDialog is opening and stop it if the selected time period falls within a break. 

    For example: 
    Private Sub RadScheduler1_AppointmentEditDialogShowing(ByVal sender As System.Object, _
                                                           ByVal e As Telerik.WinControls.UI.AppointmentEditDialogShowingEventArgs) Handles RadScheduler1.AppointmentEditDialogShowing
     
        Dim cells As List(Of SchedulerCellElement) = SchedulerUIHelper.GetSelectedCells(Me.RadScheduler1)
        If cells.Count > 0 Then
            Dim allowed As Boolean = True
            For Each cell As SchedulerCellElement In cells
                If cell.[Date].Hour >= 12 AndAlso cell.[Date].Hour <= 13 Then
                    allowed = False
                    Exit For
                End If
            Next
            If Not allowed Then
                MessageBox.Show("can't have appointments during break")
                e.AppointmentEditDialog = Nothing
                Return
            Else
                e.AppointmentEditDialog = New EditAppointmentDialog(e.Appointment, Me.RadScheduler1)
                Return
            End If
        Else
            e.AppointmentEditDialog = New EditAppointmentDialog(e.Appointment, Me.RadScheduler1)
        End If
     
    End Sub

    Hope that helps, but if you have any questions, just let me know. 
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. imran
    imran avatar
    20 posts
    Member since:
    Oct 2010

    Posted 08 Dec 2010 Link to this post

    thanks richard
  5. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 08 Dec 2010 Link to this post

    Hi Imran,

    Another thought on this. You will probably also need to capture the times entered in the EditAppointmentDialog as well as the user could change those to be within the break period.

    To do this, have a look at this article. Basically, you'll need to overide the ApplySettingsToEvent  so you can capture the times entered.

    Hope this also helps
    Richard
  6. imran
    imran avatar
    20 posts
    Member since:
    Oct 2010

    Posted 09 Dec 2010 Link to this post

    Thanks Richard you are amazing...now one thing i want to know in Radschdular about multiple y-asix...like i have multiple resources then each resource have its own yaxis....
  7. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 09 Dec 2010 Link to this post

    Hi Imran,

    The left hand side is reserved for showing various timelines, but I think perhaps what you are looking for is grouping by resources. Please have a look at this documentation on grouping by resource

    if you've got any other questions, just let me know.
    Thanks
    Richard
  8. imran
    imran avatar
    20 posts
    Member since:
    Oct 2010

    Posted 09 Dec 2010 Link to this post

    No man...you close but not exact...basicaly i need each resource have there own clock line(y axis left hand side)..
  9. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 09 Dec 2010 Link to this post

    Hi Imran,

    You'll need to add in new timezones for each grouped resource. There is a demo on your PC, and a rather good Demo with narative on Telerik TV which I think will help you.

    Hope that helps
    Richard
  10. imran
    imran avatar
    20 posts
    Member since:
    Oct 2010

    Posted 10 Dec 2010 Link to this post

    Hi Richard,

    i saw the examples ..i need to add these timezones on each resources.. i have checked in freshly new project ..i have added two resources but i couldn't found any options to add each resouce have a TimeZone...so could you help me out...how to add each resouce have its own timezone

    thanks,
    Imran khan
  11. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 10 Dec 2010 Link to this post

    Hi Imran,

    Each resource can have a timezone, but the timezone still needs to show on the far left. Try this example. It's very basic but shows 2 resources and two timeslines.

    Imports Telerik.WinControls.UI
    Imports Telerik.WinControls.UI.Scheduler
    Imports Telerik.WinControls.UI.Scheduler.Dialogs
      
    Public Class Form1
      
      
      
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      
            Dim resourcesPerView As Integer = 2
      
            Dim colors() As Color = {Color.LightBlue, Color.LightGreen, Color.LightYellow}
            Dim names() As String = {"Alan Smith", "Anne Dodsworth", "Boyan Mastoni"}
      
            For i As Integer = 0 To names.Length - 1
                Dim resource As New Telerik.WinControls.UI.Resource()
                resource.Id = New EventId(i)
                resource.Name = names(i)
                resource.Color = colors(i)
      
                Me.RadScheduler1.Resources.Add(resource)
      
                Dim view As SchedulerDayViewBase = TryCast(Me.RadScheduler1.ActiveView, SchedulerDayViewBase)
                If view IsNot Nothing Then
                    Dim schedulerTimeZone As SchedulerTimeZone = Time.GetSchedulerTimeZones(i)
                    If (Not view.TimeZones.Contains(schedulerTimeZone)) And i < resourcesPerView - 1 Then
                        view.TimeZones.Add(schedulerTimeZone)
                    End If
                End If
            Next i
      
            Me.RadScheduler1.GroupType = GroupType.Resource
            Me.RadScheduler1.GetDayView().ResourcesPerView = resourcesPerView
      
        End Sub
      
    End Class

    Hope this helps but let me know if you need more information
    Richard
  12. imran
    imran avatar
    20 posts
    Member since:
    Oct 2010

    Posted 10 Dec 2010 Link to this post

    i have attached the picture exactly what i want...in ur example it showed two timezone are close to each other..but i need these timeZone is under there respective resource....in Attached Picture i marked the timezone where i need.. Please see the attched picture


    thanks
    Imran khan 
  13. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 10 Dec 2010 Link to this post

    Hi Imran,

    As far as I know, though I may be proven wrong, that's not currently possible. I think you'd need a separate scheduler for each one to show it like that.
    Regards,
    Richard
  14. imran
    imran avatar
    20 posts
    Member since:
    Oct 2010

    Posted 10 Dec 2010 Link to this post

    Basicaly my over all Scenario is i have two Doctors each doctors have individual work time and intervals like one doctor have 9 to 6 with 20 minutes interval time and other have 9 to 5 with 15 minutes interval time....so both doctor have different time slot for taking an appointment.
    on this Scenerio i need each resource to have there own Y-axis line so that Doctor can properly take an appointment of his own interval time...


    thanks,
     imran khan
  15. imran
    imran avatar
    20 posts
    Member since:
    Oct 2010

    Posted 10 Dec 2010 Link to this post

    ok fine but how can i associate the diferrent radSchduler(dynamically created in code) with RadSchedulerNavigator..
    i am doing like that

     

     

    For index As Integer = 0 To 2

    Dim lRAd as new RadScheduler()
    RadSchedulerNavigator1.AssociateScheduler = lRAd

    Next index

    it Associate with one RadScheduler...i need it to associate with both radscheduler with same navigator

    thanks,
    Imran khan

  16. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 10 Dec 2010 Link to this post

    Hi Imran,

    This is the first time any of these questions have been presented, so this is new to me as well. It is only possible to associate one RadScheduler with a SchedulerNavigator. My first thought would be to associate it with one, and then whatever actions you perform on one scheduler to mirror on the other.

    Hope this helps
    Richard
  17. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 14 Dec 2010 Link to this post

    Hello Imran,

    Thank you Richard for the information.

    Imran, the solution that are you looking for concerns setting one RadSchedulerNavigator and two RadScheduler objects. The first RadScheduler is associated to the RadSchedulerNavigator. The next step is to subscribe to the events of the RadSchedulerNavigator -  MonthViewClick, DayViewClick, WeekViewClick, ShowWeekendsStateChanged, NavigateForwardClick, NavigateBackwardClick and also to the event ValueChanged of the TimeZonesDropDown in the SchedulerNavigatorElement. On this events you can synchronize both schedulers making them represent the same views and the same starting date.

    In case that you have other questions, feel free to write us back.

    Greetings,
    Dobry Zranchev
    the Telerik team
    Get started with RadControls for WinForms with numerous videos and detailed documentation.
  18. imran
    imran avatar
    20 posts
    Member since:
    Oct 2010

    Posted 19 Jan 2011 Link to this post

    Hi Dobry,
      Thanks...i didnt find the customizable  recurrence dialog....please help me to customize the recurrence Dialog...

    thanks,
    Imran 

  19. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 21 Jan 2011 Link to this post

    Hello imran,

    Thank you for writing.
    You can find the answer to your question in this forum thread.

    Best wishes,
    Dobry Zranchev
    the Telerik team
    Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
  20. imran
    imran avatar
    20 posts
    Member since:
    Oct 2010

    Posted 26 Jan 2011 Link to this post

    I have a new button on my form...when i m click this button the editappoinmentdialogu is open and when m clicking the ok botton on editappointmentdialoge it save the appoint on rad scheduler...
  21. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 26 Jan 2011 Link to this post

    Hello Imran,

    the details of how to launch the EditAppointmentDialog from a button / menu can be found in this forum post
    Hope that helps
    Richard
Back to Top
UI for WinForms is Visual Studio 2017 Ready