How to add context menu to wpf datagrid?
57,569
<DataGrid>
<DataGrid.ContextMenu>
<ContextMenu>
<MenuItem Header="Click Me" Click="MenuItem_Click" />
</ContextMenu>
</DataGrid.ContextMenu>
</DataGrid>
Author by
Admin
Updated on July 09, 2022Comments
-
Admin almost 2 years
How does one add a
ContextMenu
to aDataGrid
? I want to be able to right click anywhere on the DataGrid. -
Enrico over 10 yearsYou can add a checkbox to the MenuItem by adding IsCheckable="true"