Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TileView.ContextButtonCustomize Event

Allows you to customize context buttons for individual TileView tiles.

Namespace: DevExpress.XtraGrid.Views.Tile

Assembly: DevExpress.XtraGrid.v24.2.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

#Declaration

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

#Event Data

The ContextButtonCustomize event's data class is TileViewContextButtonCustomizeEventArgs. 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 tile.

#Remarks

By default, all TileView tiles 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 tile) and the e.Item parameter to get and modify the current context button.

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

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

See the TileView.ContextButtons property for details.

See Also