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

Disable right click or double click on RadScheduler

2 Answers 470 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Amit
Top achievements
Rank 1
Amit asked on 24 Feb 2011, 06:31 AM
Hi Telerik Team,

I want to restrict adding new appointments on to the scheduler i.e. it wont be possible to add a new appointment either by right click or double click.

i have tried to use read only property but it didn't work. So what is the other solution to restrict adding the new appointments.?

Also i want to change the text while adding a new appointment i.e. "new appointment" to any text on right clicking the scheduler.

So how do i change the text.?

Thanks & Regards
Amit Thakkar

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Feb 2011, 09:37 AM
Hello Amit,

You can set the e AllowInsert to false to prevent the insertion of new appointments on double clicking. For canceling the insertion on RightClick, cancel the event by subscribing the OnClientTimeSlotContextMenuItemClicking event.

You can add your custom text by setting the property Localization-ContextMenuAddAppointment
aspx:
<telerik:RadScheduler ID="RadScheduler1" Localization-ContextMenuAddAppointment="Add the appointment" StartEditingInAdvancedForm="true" TimeSlotContextMenuSettings-EnableDefault="true"  AllowInsert="False" OnClientTimeSlotContextMenuItemClicking="CancelInserting">
</telerik:RadScheduler>

clientside:
function CancelInserting(sender, args)
 {
if (args.get_item().get_text() == "Add the appointment") // Here "Add the appointment" is the TimeSlotContextMenuItem text
      {
           args.set_cancel(true);
           alert("can't insert");
      }
   }

Thanks,
Shinu.
0
Amit
Top achievements
Rank 1
answered on 25 Feb 2011, 12:43 PM
Hello Shinu,

Thanks for the reply. It worked.

Regards
Amit Thakkar
Tags
Scheduler
Asked by
Amit
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Amit
Top achievements
Rank 1
Share this question
or