BootstrapGridView.EditFormLayoutCreated Event
Enables you to perform custom actions in response to the layout creation.
Namespace: DevExpress.Web.Bootstrap
Assembly: DevExpress.Web.Bootstrap.v24.2.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 |
---|---|
Edit |
Gets the form layout. |
Row |
Gets the row’s key value.
Inherited from ASPx |
Row |
Gets the row’s visible index.
Inherited from ASPx |
The event data class exposes the following methods:
Method | Description |
---|---|
Find |
Returns a layout item that belongs to the specified column.
Inherited from ASPx |
Find |
Returns a layout item or group object with the specified name.
Inherited from ASPx |
#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.
protected void grid_EditFormLayoutCreated(object sender, BootstrapGridViewEditFormLayoutEventArgs e) {
var layoutGroupDismissal = (BootstrapGridViewLayoutGroup)e.FindLayoutItemOrGroup("DismissalInformation");
if(layoutGroupDismissal == null) return;
if(GridViewEditFormLayout.IsNewRowEditing) {
layoutGroupDismissal.Visible = false;
return;
}
var fireDate = GridViewEditFormLayout.GetRowValues(e.RowVisibleIndex, "FireDate");
layoutGroupDismissal.ClientVisible = fireDate != null && (DateTime)fireDate != DateTime.MinValue;
}