Back to Devexpress

TileView.CustomRowCellEditForEditing Event

windowsforms-devexpress-dot-xtragrid-dot-views-dot-tile-dot-tileview-9fa6e002.md

latest4.3 KB
Original Source

TileView.CustomRowCellEditForEditing Event

Allows you to replace default editors in an Edit Form with custom ones.

Namespace : DevExpress.XtraGrid.Views.Tile

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
[DXCategory("Editor")]
public event CustomRowCellEditEventHandler CustomRowCellEditForEditing
vb
<DXCategory("Editor")>
Public Event CustomRowCellEditForEditing As CustomRowCellEditEventHandler

Event Data

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

PropertyDescription
CellValueReturns the currently processed cell value. Inherited from CustomRowCellEventArgs.
ColumnGets the column to which the currently processed cell corresponds. Inherited from CustomRowCellEventArgs.
RepositoryItemGets or sets the editor used to edit the currently processed cell.
RowHandleGets the handle of the row that contains the processed cell. Inherited from CustomRowCellEventArgs.

Remarks

By default, editors for columns in an Edit Form are automatically created based on the column data type. For instance, texts are edited using the TextEdit control. The CustomRowCellEditForEditing event fires when an Edit Form is about to be displayed, allowing you to provide custom editors for columns. To determine the currently processed column and row, read the Column and RowHandle arguments. To specify a custom editor, use the RepositoryItem property. The code below shows how to use the SpinEdit control to edit the Year Built column instead of the TextEdit control used by default.

csharp
private void tileView1_CustomRowCellEditForEditing(object sender, Views.Grid.CustomRowCellEditEventArgs e) {
    DevExpress.XtraGrid.Views.Tile.TileView view = sender as DevExpress.XtraGrid.Views.Tile.TileView;
    if (view == null) return;
    if (e.Column == view.Columns["YearBuilt"]) {
        XtraEditors.Repository.RepositoryItemSpinEdit editor = new XtraEditors.Repository.RepositoryItemSpinEdit();
        editor.MaxValue = DateTime.Now.Year;
        e.RepositoryItem = editor;
    } 
}
vb
Private Sub tileView1_CustomRowCellEditForEditing(sender As Object, e As DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs) Handles tileView1.CustomRowCellEditForEditing
    Dim view As DevExpress.XtraGrid.Views.Tile.TileView = TryCast(sender, DevExpress.XtraGrid.Views.Tile.TileView)
    If view Is Nothing Then
        Return
    End If
    If e.Column.Equals(view.Columns("YearBuilt")) Then
        Dim editor As New XtraEditors.Repository.RepositoryItemSpinEdit()
        editor.MaxValue = DateTime.Now.Year
        e.RepositoryItem = editor
    End If
End Sub

See Also

TileView Class

TileView Members

DevExpress.XtraGrid.Views.Tile Namespace