We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Cancel key pressing

Hi folks,

I need cancel any keyboard input pressing on schedule view (specially Del key). I have tested:

                    <schedule:SfSchedule x:Name="schedule" Grid.Column="0" Grid.Row="0"
                        CurrentDateBackground="DarkCyan"
                        CurrentDateForeground="White"
                        CellSelectionBrush="DarkBlue"
                        ScheduleType="Month"
                        ScheduleClick="schedule_ScheduleClick"
                        PreviewKeyDown="schedule_PreviewKeyDown"/>


        private void schedule_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            e.Handled = false;
        }

But Del que still deletes appointments (I do not want to delete using keyboard)

Cheers

2 Replies

SP Subburaj Pandian Veluchamy Syncfusion Team July 27, 2017 06:16 PM UTC

Hi Josep, 
 
Thank you for contacting Syncfusion support. 
 
Currently we are checking on this requirement to achieve in sample level, we will analyze and update you the details at the earliest. We appreciate your patience until then. 
 
Regards,   
Subburaj Pandian V.     



VR Vigneshkumar Ramasamy Syncfusion Team July 28, 2017 09:56 AM UTC

Hi Josep 
 
Thanks for your patience. 
 
As of now we don’t have any direct support to prevent deleting appointment when Delete key pressed. But we have created a sample level workaround to achieve your requirement by using AppointmentCollectionChanged event. Please find the sample in the below link. 
 
Sample link:
SfSchedule_WPF
 
 
In the above sample based on the NotifyCollectionChangedAction we have achieved your requirement. Please find the below code snippet for the same. 
 
private void Schedule_AppointmentCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) 
        { 
            if (e.Action == NotifyCollectionChangedAction.Remove && this.isDeleteButtonPressed) 
            { 
 
            } 
        } 
 
Please let us know if you have any concern. 
 
Regards 
Vigneshkumar R 


Loader.
Live Chat Icon For mobile
Up arrow icon