Skip to main content
Tab

ASPxGridView.FindRowCellTemplateControlByKey(Object, GridViewDataColumn, String) Method

Searches for the server control contained within the specified data cell‘s template.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.2.dll

Declaration

public Control FindRowCellTemplateControlByKey(
    object rowKey,
    GridViewDataColumn gridViewDataColumn,
    string id
)

Parameters

Name Type Description
rowKey Object

An object that uniquely identifies the row.

gridViewDataColumn GridViewDataColumn

A GridViewDataColumn descendant that represents the data column where the requested cell resides. If null (Nothing in Visual Basic), the search is performed within all cells in the specified row.

id String

A String value that identifies the control within the specified cell.

Returns

Type Description
Control

A Control object that represents the control contained within the specified data cell’s template.

Remarks

For more information, see Templates.

<dx:ASPxGridView ID="Grid" runat="server" OnHtmlRowPrepared="Grid_HtmlRowPrepared" ...>
    <Columns>
        <dx:GridViewDataTextColumn FieldName="Name">
            <DataItemTemplate>
                <dx:ASPxButtonEdit ID="ButtonEdit" runat="server">
                    <!-- ... -->
                </dx:ASPxButtonEdit>
            </DataItemTemplate>
        </dx:GridViewDataTextColumn>
    </Columns>
    <!-- ... -->
</dx:ASPxGridView>
protected void Grid_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) {
    ASPxButtonEdit buttonEdit = Grid.FindRowCellTemplateControlByKey(e.rowKey,
        Grid.Columns["Name"] as GridViewDataColumn, "ButtonEdit") as ASPxButtonEdit;
    // ...
}
See Also