Skip to content

Define a cell's context menu that allows users to delete a row or copy its data to the clipboard.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/how-to-access-and-remove-rows-by-using-a-custom-cells-context-menu-e1558

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

110 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WPF Data Grid - Display a Context Menu for Data Cells

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.

image

To specify a context menu, add BarItems to the TableView's RowCellMenuCustomizations collection. The menu item's DataContext property is set to an object of the GridCellMenuInfo type. That allows you to use the Row.Row.[Property_Name] path to access data source properties.

In this example, the Delete button is enabled only for rows whose CanBeDeleted property is true:

<dxb:BarButtonItem Name="deleteRowItem" Content="Delete"
                   IsEnabled="{Binding Row.Row.CanBeDeleted}"
                   ItemClick="OnDeleteRow"/>

Files to look at

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Define a cell's context menu that allows users to delete a row or copy its data to the clipboard.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •