alexa
Syncfusion
menu Syncfusion

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class ContextMenuClosedEventArgs

    Provides data for the context menu closed event.

    Inheritance
    object
    EventArgs
    ContextMenuClosedEventArgs
    Inherited Members
    EventArgs.Empty
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Syncfusion.Maui.DataGrid
    Assembly: Syncfusion.Maui.DataGrid.dll
    Syntax
    public class ContextMenuClosedEventArgs : EventArgs
    Remarks

    This event argument is raised after a context menu has been fully dismissed. It can be used to perform cleanup or update UI elements after the menu is closed.

    Examples

    Here is an example of how to use the ContextMenuClosedEventArgs class in the ContextMenuClosed event.

    [XAML]

    <syncfusion:SfDataGrid x:Name="dataGrid"
                            ItemsSource="{Binding YourData}"
                            AutoGenerateColumns="True"
                            ContextMenuClosed="DataGrid_ContextMenuClosed" />

    [C#]

    private void DataGrid_ContextMenuClosed(object sender, ContextMenuClosedEventArgs e)
    {
        // Perform cleanup or update UI after the menu is closed
        Console.WriteLine("Context menu closed.");
    
        // Access the column that triggered the menu
        var column = e.Column;
    
        // Inspect the menu items that were displayed
        foreach (var item in e.MenuItems)
        {
            Console.WriteLine($"Closed Menu Item: {item.Text}");
        }
    }

    Constructors

    ContextMenuClosedEventArgs()

    Initializes a new instance of the ContextMenuClosedEventArgs class.

    Declaration
    public ContextMenuClosedEventArgs()

    Properties

    Column

    Gets or sets the column associated with the context menu.

    Declaration
    public DataGridColumn Column { get; set; }
    Property Value
    Type Description
    DataGridColumn

    The column for which the context menu was closed.

    Remarks

    This property indicates which column triggered the context menu. It may be null if the menu was not triggered by a specific column.

    MenuItems

    Gets or sets the menu items that were displayed before closing.

    Declaration
    public IList<MenuItem> MenuItems { get; set; }
    Property Value
    Type Description
    IList<MenuItem>

    The collection of menu items that were shown in the context menu.

    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved