This is a migrated thread and some comments may be shown as answers.

[Solved] Disable an appointment from being edited by a user

9 Answers 227 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Sunil
Top achievements
Rank 1
Sunil asked on 29 May 2008, 09:47 PM
How to disable an appointment from being edited or deleted by a user depending on a certain criteria.

9 Answers, 1 is accepted

Sort by
0
antonio
Top achievements
Rank 1
answered on 30 May 2008, 01:41 PM
I would suggest using the 'OnClient...' events and handle the validation of user rights using Javascripts.  After that you have the option to let the process continue or cancel it.

HTH
0
Peter
Telerik team
answered on 30 May 2008, 03:27 PM

Server-side solution is also possible. For example:
protected void RadScheduler1_AppointmentDataBound(object sender, Telerik.Web.UI.SchedulerEventArgs e)  
    {          
        if([MyUserCondition])  
        {  
            e.Appointment.AllowDelete = false;  
            e.Appointment.AllowEdit = false;  
        }         
    } 




Best wishes,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Sunil
Top achievements
Rank 1
answered on 30 May 2008, 09:35 PM

function onAppointmentClick(sender, eventArgs)

{

alert(

"Appointment click: " + eventArgs.get_appointment().get_subject());

if(eventArgs.get_appointment().get_subject() == 'Breakfast')

{

eventArgs.AllowDelete =

false;

}

}

I added this function. How do I cancel the next serverside or even how not to display the DELETE X on the right hand corner of the appointment.

0
Sunil
Top achievements
Rank 1
answered on 30 May 2008, 09:35 PM

function onAppointmentClick(sender, eventArgs)

{

alert(

"Appointment click: " + eventArgs.get_appointment().get_subject());

if(eventArgs.get_appointment().get_subject() == 'Breakfast')

{

eventArgs.AllowDelete =

false;

}

}

I added this function. How do I cancel the next serverside or even how not to display the DELETE X on the right hand corner of the appointment.

0
Sunil
Top achievements
Rank 1
answered on 30 May 2008, 09:40 PM
Is there a server side equivalent of this. I used :

protected void RadScheduler1_AppointmentDataBound(object sender, Telerik.Web.UI.SchedulerEventArgs e)

{

e.Appointment.AllowDelete =

false;

e.Appointment.AllowEdit =

false;

}
 and this doesnt seem to be helping out. It doesnt seem to recognize this. I am also not able to get response.write on this event handler.

0
Peter
Telerik team
answered on 02 Jun 2008, 01:16 PM

Hi Sunil,

Probably, you haven't attached to the event handler. Could you please use a debugger to verify if you get in the
AppointmentDataBound event handler. Note, that using Response.Write will not be a valid test if you have AJAX involved.

You can send us a simple working demo project via a support ticket too.


Best wishes,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Sunil
Top achievements
Rank 1
answered on 02 Jun 2008, 02:49 PM
No it does not take me into AppointmentDataBound event handler. If I am in debug mode, it rarerly works. The webpage doesnt show up at all. Just says loading and the VS seems to be doing something but it doesnt succeed. There are no compiler errors.
0
Peter
Telerik team
answered on 02 Jun 2008, 02:54 PM


In this case, we will wait for a support ticket with a simple project demonstrating this problem.


Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Sunil
Top achievements
Rank 1
answered on 02 Jun 2008, 03:20 PM
The problem with VS.net debugging still exists. But i was able to get teh server side disabling of an appointment working with your example. With AllowEdit or AllowDelete = false, the X symbol is not seen. Thanks you very much.
Tags
Scheduler
Asked by
Sunil
Top achievements
Rank 1
Answers by
antonio
Top achievements
Rank 1
Peter
Telerik team
Sunil
Top achievements
Rank 1
Share this question
or