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

how to disable the delete action in context menu

Hello,

How to disable the delete action in context menu of a schedule without declare new context menu ?

2 Replies

VR Vigneshkumar Ramasamy Syncfusion Team April 19, 2016 06:43 AM UTC

Dear Customer,

Thanks for using Syncfusion product.

As of now your requirement of disable delete option in the context menu can be achieved by overriding the default template of EditRadialMenuControl in the schedule control. We have prepared sample for the same and please find the sample in the below link.

Sample Link: Schedule_DisableMenu

In above sample we have used below code snippet to disable the delete option in the context menu.


<
radialmenu:SfRadialMenuItem IsEnabled="False" IsHitTestVisible="False" Opacity="0.1"  GroupName="ContextMenu">

                                <radialmenu:SfRadialMenuItem.Header>

                                    <Border Background="Transparent" Padding="5">

                                        <StackPanel>

                                            <Path UseLayoutRounding="False" Stretch="Fill" Width="15" RenderTransformOrigin="0.5,0.5" Opacity="1" Height="20" Fill="#484949" Data="M33.977998,27.684L33.977998,58.102997 41.373998,58.102997 41.373998,27.684z M14.841999,27.684L14.841999,58.102997 22.237998,58.102997 22.237998,27.684z M4.0319996,22.433001L52.183,22.433001 52.183,63.999001 4.0319996,63.999001z M15.974,0L40.195001,0 40.195001,7.7260003 56.167001,7.7260003 56.167001,16.000999 0,16.000999 0,7.7260003 15.974,7.7260003z" />

                                            <TextBlock x:Name="EditDeleteMenuText" Margin="0,5,0,0" Text="Delete" Foreground="#484949" HorizontalAlignment="Center"/>

                                        </StackPanel>

                                    </Border>

                                </radialmenu:SfRadialMenuItem.Header>

                            </radialmenu:SfRadialMenuItem>



Regards

Vigneshkumar R



VR Vigneshkumar Ramasamy Syncfusion Team April 19, 2016 07:02 AM UTC

Dear Customer,

Please ignore the previous update.

As of now your requirement of disable delete option in the context menu can be achieved by overriding the default template of EditRadialMenuControl in the schedule control. We have prepared sample for the same and please find the sample in the below link.

Sample Link:
Schedule_DisableMenu

In above sample we have used below code snippet to disable the delete option in the context menu.


<
radialmenu:SfRadialMenuItem IsEnabled="False" IsHitTestVisible="False" Opacity="0.1"  GroupName="ContextMenu">

                                <radialmenu:SfRadialMenuItem.Header>

                                    <Border Background="Transparent" Padding="5">

                                        <StackPanel>

                                            <Path UseLayoutRounding="False" Stretch="Fill" Width="15" RenderTransformOrigin="0.5,0.5" Opacity="1" Height="20" Fill="#484949" Data="M33.977998,27.684L33.977998,58.102997 41.373998,58.102997 41.373998,27.684z M14.841999,27.684L14.841999,58.102997 22.237998,58.102997 22.237998,27.684z M4.0319996,22.433001L52.183,22.433001 52.183,63.999001 4.0319996,63.999001z M15.974,0L40.195001,0 40.195001,7.7260003 56.167001,7.7260003 56.167001,16.000999 0,16.000999 0,7.7260003 15.974,7.7260003z" />

                                            <TextBlock x:Name="EditDeleteMenuText" Margin="0,5,0,0" Text="Delete" Foreground="#484949" HorizontalAlignment="Center"/>

                                        </StackPanel>

                                    </Border>

                                </radialmenu:SfRadialMenuItem.Header>

                            </radialmenu:SfRadialMenuItem>


Note: The above solution is applicable only for UWP windows platform and for UWP windows phone, you need to create custom radial menu to disable the delete option.

Regards

Vigneshkumar R


Loader.
Up arrow icon