Skip to main content
A newer version of this page is available. .

WinExplorerView.ContextButtonCustomize Event

Allows you to customize individual context buttons for specific WinExplorerView items.

Namespace: DevExpress.XtraGrid.Views.WinExplorer

Assembly: DevExpress.XtraGrid.v19.2.dll

Declaration

[DXCategory("Context Buttons")]
public event WinExplorerViewContextButtonCustomizeEventHandler ContextButtonCustomize

Event Data

The ContextButtonCustomize event's data class is WinExplorerViewContextButtonCustomizeEventArgs. The following properties provide information specific to this event:

Property Description
Item Gets the currently processed context button.
RowHandle Gets the row handle of the currently processed data record.

Remarks

By default, all WinExplorerView items display the same context buttons with equal settings. Handle the ContextButtonCustomize event to override these global settings. Use the e.RowHandle parameter to get the current data row (and thus, the current view item) and e.Item parameter to get and modify the current context button.

The code below hides all context buttons for all view items that represent odd data rows.

private void winExplorer1_ContextButtonCustomize(object sender, DevExpress.XtraGrid.Views.WinExplorer.WinExplorerContextButtonCustomizeEventArgs e) {
    if (e.RowHandle % 2 == 0) e.Item.Visibility = DevExpress.Utils.ContextItemVisibility.Hidden;
}

See the ‘Context Buttons’ section of the WinExplorer View topic for more info.

See Also