Articles in this section
Category / Section

How to close the RadialMenu on clicking a menu item?

1 min read

To close a RadialMenu on clicking the RadialMenuItem, set CloseOnExecute property to True for menuitems.  The same has been demonstrated in the following code example:

XAML:

<Window x:Class="SfRadialMenuItem_New.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:navigation="clr-namespace:Syncfusion.Windows.Controls.Navigation;assembly=Syncfusion.SfRadialMenu.Wpf"
Title="MainWindow" Height="350" Width="525">
<Grid x:Name="Grid1">
<navigation:SfRadialMenu x:Name="_Radialmenu">
<navigation:SfRadialMenuItem Header="MenuItem1" CloseOnExecute="True" />
<navigation:SfRadialMenuItem Header="MenuItem2" CloseOnExecute="True"/>
<navigation:SfRadialMenuItem Header="MenuItem3" CloseOnExecute="True"/>
<navigation:SfRadialMenuItem Header="MenuItem4" CloseOnExecute="True"/>
<navigation:SfRadialMenuItem Header="MenuItem5" CloseOnExecute="True"/>
</navigation:SfRadialMenu>
</Grid>
</Window>

 

C#:

namespace SfRadialMenuItem_New
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
SfRadialMenu _Radialmenu = new SfRadialMenu();
SfRadialMenuItem Item1 = new SfRadialMenuItem();
Item1.Header = "MenuItem1";
Item1.CloseOnExecute = true;
SfRadialMenuItem Item2 = new SfRadialMenuItem();
Item2.Header = "MenuItem2";
Item2.CloseOnExecute = true;
SfRadialMenuItem Item3 = new SfRadialMenuItem();
Item3.Header = "MenuItem3";
Item3.CloseOnExecute = true;
SfRadialMenuItem Item4 = new SfRadialMenuItem();
Item4.Header = "MenuItem4";
Item4.CloseOnExecute = true;
SfRadialMenuItem Item5 = new SfRadialMenuItem();
Item5.Header = "MenuItem5";
Item5.CloseOnExecute = true;
_Radialmenu.Items.Add(Item1);
_Radialmenu.Items.Add(Item2);
_Radialmenu.Items.Add(Item3);
_Radialmenu.Items.Add(Item4);
_Radialmenu.Items.Add(Item5);
Grid1.Children.Add(_Radialmenu);
}
}
}
 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied