How can I stop users amending SOME appointments

6 posts, 1 answers
  1. Karl balshaw
    Karl balshaw avatar
    3 posts
    Member since:
    Dec 2009

    Posted 02 Nov 2010 Link to this post

    Hi,

    I am using the scheduler in TimeLineView and create my appointments programmatically.  I want the users to be able to amend the dates and duration of some of the appointments, but not others.

     

    I have set the appointment.AllowEdit to false, but this doesn’t seem to work, as the user can still amend the appointment.

     

    Any thoughts or suggestions

     

    Karl

  2. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 05 Nov 2010 Link to this post

    Hello Karl,

    Thank you for writing.

    You can use a custom EditAppointmentDialog which modifies only dates and duration. Please, take a look at the Scheduler >> Binding example in our Examples application. This example demonstrates how to add a custom field in the EditAppointmentDialog. In addition, you can read the available scheduler documentation here.

    I hope this helps.

    All the best,
    Dobry Zranchev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Karl balshaw
    Karl balshaw avatar
    3 posts
    Member since:
    Dec 2009

    Posted 08 Nov 2010 Link to this post

    Thank you for your response, and I will be using the custom dialog box soon, however, this query was regarding directly amending the appointments.

    The user can select an appointment, drag it to another date, or change the duration.

    This is functionality I use and like, however, I am also adding appointments for reference, and as such do not want the user to be able to use this functionality.

    I have set the AllowEdit to false on the appointment when I create it, but it still can be moved and changed directly (without the use of a dialog).

    I hope this clears up my query, thanks ini advance
  5. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 09 Nov 2010 Link to this post

    Hello Karl,

    If you want to stop an individual appointment from moving, then you could use the following:

    Private Sub RadScheduler1_AppointmentMouseDown(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.SchedulerAppointmentMouseEventArgs) Handles RadScheduler1.AppointmentMouseDown
        If e.Appointment.Summary = "Test" Then
            Me.RadScheduler1.AllowAppointmentMove = False
            Me.RadScheduler1.AllowAppointmentResize = False
        Else
            Me.RadScheduler1.AllowAppointmentMove = True
            Me.RadScheduler1.AllowAppointmentResize = True
        End If
    End Sub

    hope that helps
    Richard
  6. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 10 Nov 2010 Link to this post

    Hello Karl,

    How did you get on with this? If this has helped, may I ask you to mark as answer so others can find the solution too. If you need any other help, just let me know and I'll be happy to assist.

    Thanks
    Richard
  7. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 12 Nov 2010 Link to this post

    Hello,

    Thank you for writing.

    Richard's solution is correct. You can do just one more thing to optimize the code:
    void radScheduler1_AppointmentMouseDown(object sender, SchedulerAppointmentMouseEventArgs e)
    {
        this.radScheduler1.AllowAppointmentMove = e.Appointment.AllowEdit;
        this.radScheduler1.AllowAppointmentResize = e.Appointment.AllowEdit;
    }

    This will avoid the resizing and dragging operations only if the appointment is not editable.

    All the best,
    Dobry Zranchev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready