Skip to main content

BootstrapGridView.EditFormLayoutCreated Event

Enables you to perform custom actions in response to the layout creation.

Namespace: DevExpress.Web.Bootstrap

Assembly: DevExpress.Web.Bootstrap.v24.1.dll

NuGet Package: DevExpress.Web.Bootstrap

Declaration

public event EventHandler<BootstrapGridViewEditFormLayoutEventArgs> EditFormLayoutCreated

Event Data

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

Property Description
EditFormLayout Gets the form layout.
RowKeyValue Gets the row’s key value. Inherited from ASPxGridViewEditFormLayoutEventArgs.
RowVisibleIndex Gets the row’s visible index. Inherited from ASPxGridViewEditFormLayoutEventArgs.

The event data class exposes the following methods:

Method Description
FindLayoutItemByColumn(String) Returns a layout item that belongs to the specified column. Inherited from ASPxGridViewEditFormLayoutEventArgs.
FindLayoutItemOrGroup(String) Returns a layout item or group object with the specified name. Inherited from ASPxGridViewEditFormLayoutEventArgs.

Remarks

The component raises the EditFormLayoutCreated event for each data row when the form layout is created. You can handle this event to change layout items’ styles or settings based on cell values.

In addition to the event argument properties, you can use the FindLayoutItemByColumn(String) and FindLayoutItemOrGroup(String) methods to access and modify layout items or groups.

The following example illustrates how to use the FindLayoutItemOrGroup(String) method to find the “DismissalInformation” layout group and make this group visible on the client if a user enters a value in the “Dismissal Date” field.

<dx:BootstrapGridView ID="GridViewEditFormLayout" OnEditFormLayoutCreated="grid_EditFormLayoutCreated">
    <Columns>
        <dx:BootstrapGridViewDateColumn FieldName="FireDate" Visible="false" />
        ...
    </Columns>
    <SettingsEditing>
       <FormLayoutProperties>
            <Items>
                 <dx:BootstrapGridViewTabbedLayoutGroup>
                     <Items>
                         <dx:BootstrapGridViewLayoutGroup  Caption="Employee Information">
                             <Items >
                                 <dx:BootstrapGridViewLayoutGroup ShowCaption="False">
                                     <Items>
                                         <dx:BootstrapGridViewColumnLayoutItem ColumnName="HireDate" />
                                         <dx:BootstrapGridViewColumnLayoutItem ColumnName="Title" />
                                         <dx:BootstrapGridViewColumnLayoutItem ColumnName="FireDate"
                                             Caption="Dismissal Date" HelpText="When you specify 
                                             a dismissal date, an additional 'Dismissal Information' 
                                             tab will be shown." />
                                     </Items>
                                 </dx:BootstrapGridViewLayoutGroup>
                                 ...
                             </Items>
                         </dx:BootstrapGridViewLayoutGroup>
                     </Items>
                 </dx:BootstrapGridViewTabbedLayoutGroup>
                 ...
            </Items>
        </FormLayoutProperties>
    </SettingsEditing>
</dx:BootstrapGridView>
See Also