DataViewBase.RowCellMenuCustomizations Property
Allows you to customize the row cell‘s context menu. You can add new menu items or remove existing items.
Namespace: DevExpress.Xpf.Grid
Assembly: DevExpress.Xpf.Grid.v24.2.Core.dll
NuGet Package: DevExpress.Wpf.Grid.Core
Declaration
Property Value
Type | Description |
---|---|
BarManagerActionCollection | A collection of bar actions to customize the row cell‘s context menu. |
Remarks
- This property is not supported in the TreeListControl with the Hierarchical Data Templates.
- This property is not supported in the CardView.
Refer to the Context Menus topic for more information.
Example
This example shows how to define a cell’s context menu. The context menu allows users to delete a row or copy its data to the clipboard.
<dxg:GridControl.View>
<dxg:TableView x:Name="view" AutoWidth="True">
<dxg:TableView.RowCellMenuCustomizations>
<dxb:BarButtonItem Name="deleteRowItem" Content="Delete"
IsEnabled="{Binding Row.Row.CanBeDeleted}"
ItemClick="OnDeleteRow"/>
<dxb:BarButtonItem Name="copyCellDataItem" Content="Copy"
ItemClick="OnCopyRow" />
</dxg:TableView.RowCellMenuCustomizations>
</dxg:TableView>
</dxg:GridControl.View>
void OnCopyRow(object sender, ItemClickEventArgs e) {
if (view.GridMenu.MenuInfo is GridCellMenuInfo menuInfo && menuInfo.Row != null)
grid.CopyCurrentItemToClipboard();
}
void OnDeleteRow(object sender, ItemClickEventArgs e) {
if (view.GridMenu.MenuInfo is GridCellMenuInfo menuInfo && menuInfo.Row != null)
view.DeleteRow(menuInfo.Row.RowHandle.Value);
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the RowCellMenuCustomizations property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.