Back to Devexpress

ASPxGridView.HtmlEditFormCreated Event

aspnet-devexpress-dot-web-dot-aspxgridview-699574e2.md

latest2.8 KB
Original Source

ASPxGridView.HtmlEditFormCreated Event

Occurs when a table row, which corresponds to the Edit Form, has been created.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public event ASPxGridViewEditFormEventHandler HtmlEditFormCreated
vb
Public Event HtmlEditFormCreated As ASPxGridViewEditFormEventHandler

Event Data

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

PropertyDescription
EditFormGets the web control that represents the Edit Form.

Remarks

If the GridViewEditingMode.PopupEditForm mode is enabled, the ASPxGridView.HtmlRowCreated event, which enables you to initialize editors contained within the Edit Form template, isn’t raised. In this instance, you should handle the HtmlEditFormCreated event. The web control, which represents the Edit Form can be accessed via the event parameter’s EditForm property.

csharp
protected void ASPxGridView1_HtmlEditFormCreated(object sender,
    DevExpress.Web.ASPxGridViewEditFormEventArgs e) {
    Control wc = ASPxGridView1.FindEditFormTemplateControl("ASPxButtonEdit1");
    if (wc != null) {
        ASPxButtonEdit templateEdit = wc as ASPxButtonEdit;
        //
        // Initialize the editor as required
        //
        templateEdit.ForeColor = System.Drawing.Color.Blue;
    }
}
vb
Protected Sub ASPxGridView1_HtmlEditFormCreated(ByVal sender As Object, ByVal e As DevExpress.Web.ASPxGridViewEditFormEventArgs)
    Dim wc As Control = ASPxGridView1.FindEditFormTemplateControl("ASPxButtonEdit1")
    If wc IsNot Nothing Then
        Dim templateEdit As ASPxButtonEdit = TryCast(wc, ASPxButtonEdit)
        '
        ' Initialize the editor as required
        '
        templateEdit.ForeColor = System.Drawing.Color.Blue
    End If
End Sub

See Also

Grid View

ASPxGridView Class

ASPxGridView Members

DevExpress.Web Namespace