Skip to main content
Tab

ASPxGridView.HtmlCommandCellPrepared Event

Enables the settings of individual command column cells to be changed.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.2.dll

Declaration

public event ASPxGridViewTableCommandCellEventHandler HtmlCommandCellPrepared

Event Data

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

Property Description
Cell Gets the processed command cell.
CommandCellType Gets whether the processed command cell is displayed within the auto filter row or data row.
CommandColumn Gets a command column whose cell is currently being processed.
KeyValue Gets an object that uniquely identifies the data row. Inherited from ASPxGridViewItemEventArgs.
VisibleIndex Gets the visible index of the data row. Inherited from ASPxGridViewItemEventArgs.

Remarks

The HtmlCommandCellPrepared event is raised for each cell within command columns when the corresponding table cell is created. You can handle this event to change the style settings of individual command cells.

The processed cell is identified by the event parameter’s ASPxGridViewTableCommandCellEventArgs.Cell property. The column and row where the processed cell resides can be obtained via the ASPxGridViewTableCommandCellEventArgs.CommandColumn and ASPxGridViewItemEventArgs.KeyValue properties.

Example

<dx:ASPxGridView ClientInstanceName="gv" ID="ASPxGridView1" runat="server" OnHtmlCommandCellPrepared="ASPxGridView1_HtmlCommandCellPrepared" 
  AutoGenerateColumns="False" DataSourceID="SqlDataSource1" KeyFieldName="ProductID">
    <Columns>
        <dx:GridViewCommandColumn ShowDeleteButton="True" ShowEditButton="True" ShowNewButtonInHeader="True" VisibleIndex="0">
        </dx:GridViewCommandColumn>
        ...
    </Columns>
</dx:ASPxGridView>

Result:

GridView - HtmlCommandCellPrepared Event

See Also