Back to Devexpress

TileView.ContextButtonCustomize Event

windowsforms-devexpress-dot-xtragrid-dot-views-dot-tile-dot-tileview-29c353d3.md

latest3.2 KB
Original Source

TileView.ContextButtonCustomize Event

Allows you to customize context buttons for individual TileView tiles.

Namespace : DevExpress.XtraGrid.Views.Tile

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
[DXCategory("Context Buttons")]
public event TileViewContextButtonCustomizeEventHandler ContextButtonCustomize
vb
<DXCategory("Context Buttons")>
Public Event ContextButtonCustomize As TileViewContextButtonCustomizeEventHandler

Event Data

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

PropertyDescription
ItemGets the currently processed context button.
RowHandleGets 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.

csharp
private void tileView1_ContextButtonCustomize(object sender, DevExpress.XtraGrid.Views.Tile.TileViewContextButtonCustomizeEventArgs e) {
    if (e.RowHandle % 2 == 0) e.Item.Visibility = DevExpress.Utils.ContextItemVisibility.Hidden;
}
vb
Private Sub tileView1_ContextButtonCustomize(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Tile.TileViewContextButtonCustomizeEventArgs)
    If e.RowHandle Mod 2 = 0 Then
        e.Item.Visibility = DevExpress.Utils.ContextItemVisibility.Hidden
    End If
End Sub

See the TileView.ContextButtons property for details.

See Also

ContextButtons

TileView Class

TileView Members

DevExpress.XtraGrid.Views.Tile Namespace