Events in WPF Dropdown Button (DropDownButtonAdv)

The Dropdown Button control comprises of various pre-defined events to perform any required action that are illustrated below.

The event occurs before opening the dropdown menu popup and any action can be handled in the respective event handler.

<syncfusion:DropDownButtonAdv x:Name="dropdownbutton" DropDownOpening="dropdownbutton_DropDownOpening"/>
DropDownButtonAdv dropdownbutton = new DropDownButtonAdv();
dropdownbutton.DropDownOpening +=new CancelEventHandler(dropdownbutton_DropDownOpening);

private void dropdownbutton_DropDownOpening(object sender, System.ComponentModel.CancelEventArgs e)
{

}

The event occurs after opening the dropdown menu popup and any action can be handled in respective event handler.

<syncfusion:DropDownButtonAdv x:Name="dropdownbutton" DropDownOpened="dropdownbutton_DropDownOpened"/>
DropDownButtonAdv dropdownbutton = new DropDownButtonAdv();
dropdownbutton.DropDownOpened +=new RoutedEventHandler(dropdownbutton_DropDownOpened); 

private void dropdownbutton_DropDownOpened(object sender, RoutedEventArgs e)
{

}

The event occurs before closing the dropdown menu popup and any action can be handled in respective event handler.

<syncfusion:DropDownButtonAdv x:Name="dropdownbutton" DropDownClosing="dropdownbutton_DropDownClosing"/>
DropDownButtonAdv dropdownbutton = new DropDownButtonAdv();
dropdownbutton.DropDownClosing +=new CancelEventHandler(dropdownbutton_DropDownClosing);

private void dropdownbutton_DropDownClosing(object sender, System.ComponentModel.CancelEventArgs e)
{

}

The event occurs after closing the dropdown menu popup and any action can be handled in respective event handler.

<syncfusion:DropDownButtonAdv x:Name="dropdownbutton" DropDownClosed="dropdownbutton_DropDownClosed"/>
DropDownButtonAdv dropdownbutton = new DropDownButtonAdv();
dropdownbutton.DropDownClosed +=new RoutedEventHandler(dropdownbutton_DropDownClosed); 

private void dropdownbutton_DropDownClosed(object sender, RoutedEventArgs e)
{

}

Events for dropdown menu items

Click

The event occurs when the dropdown menu item is clicked and any action can be handled in respective event handler.

<syncfusion:DropDownMenuItem x:Name="dropDownMenuItem" Click="dropDownMenuItem_Click/>
DropDownMenuItem dropDownMenuItem = new DropDownMenuItem();
dropDownMenuItem.Click +=new RoutedEventHandler(dropDownMenuItem_Click);

private void dropDownMenuItem_Click(object sender, RoutedEventArgs e)
{

}

IsCheckedChanged

The event occurs when the dropdown menu item is checked or unchecked, that is, only when IsCheckable property is set to true. Any action can be handled in the respective event handler.

<syncfusion:DropDownMenuItem x:Name="dropDownMenuItem" IsCheckable="True" IsCheckedChanged="DropDownMenuItem_IsCheckedChanged"/>
DropDownMenuItem dropDownMenuItem  = new DropDownMenuItem();
dropDownMenuItem.IsCheckable=true;
dropDownMenuItem.IsCheckedChanged +=new RoutedEventHandler(dropDownMenuItem_IsCheckedChanged); 
    
private void dropDownMenuItem_IsCheckedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{

}