Dynamically change allow editing based on the property value of an entry

If an event is submitted AllowDeleting = false, if an event is not submitted then AllowDeleting should be true




1 Reply

NR Nevitha Ravi Syncfusion Team December 3, 2020 07:51 AM UTC

Hi Alex, 

Greetings from Syncfusion Support. 

We have checked your query and suspect that your requirement is to prevent the deletion and editing of a particular appointment based on a condition. For that, in the following sample we have prevented the editing and deletion if the appointment is created with the Subject name ‘Test’ using IsReadonly field. 

    public void OnActionBegin(ActionEventArgs<AppointmentData> args) 
    { 
        if (args.ActionType == ActionType.EventCreate && args.AddedRecords[0].Subject == "Test") 
        { 
            args.AddedRecords[0].IsReadonly = true; 
        } 
    } 

Please let us know whether the above solution meets your requirement, else share more details about your requirement for further assistance. 

Regards, 
Nevitha 


Loader.
Up arrow icon