TileView.CustomRowCellEditForEditing Event

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

Namespace: DevExpress.XtraGrid.Views.Tile

Assembly: DevExpress.XtraGrid.v20.1.dll

Declaration

[DXCategory("Editor")]
public event CustomRowCellEditEventHandler CustomRowCellEditForEditing
<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:

Property Description
CellValue Returns the currently processed cell value. Inherited from CustomRowCellEventArgs.
Column Gets the column to which the currently processed cell corresponds. Inherited from CustomRowCellEventArgs.
RepositoryItem Gets or sets the editor used to edit the currently processed cell.
RowHandle Gets 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.


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;
    } 
}
See Also