Skip to main content
.NET Framework 4.5.2+
  • The page you are viewing does not exist in the .NET 6.0+ platform documentation. This link will take you to the parent topic of the current section.

CreateCustomDataItemTemplateEventArgs.CreateDefaultDataItemTemplate Property

Specifies if the default data item template should be created.

Namespace: DevExpress.ExpressApp.Web.Editors.ASPx

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

NuGet Package: DevExpress.ExpressApp.Web

Declaration

public bool CreateDefaultDataItemTemplate { get; set; }

Property Value

Type Description
Boolean

true, if the default data item template should be created; otherwise, false.

Remarks

You can enable data item templates for individual columns, e.g., for columns showing business objects, using the ASPxGridListEditor.CreateCustomDataItemTemplate event:

public class ViewController1 : ViewController<ListView> {
    ASPxGridListEditor gridListEditor;
    protected override void OnActivated() {
        base.OnActivated();
        gridListEditor = View.Editor as ASPxGridListEditor;
        if (gridListEditor != null) {
            gridListEditor.CreateCustomDataItemTemplate += gridListEditor_CreateCustomDataItemTemplate;
        }
    }
    void gridListEditor_CreateCustomDataItemTemplate(object sender, CreateCustomDataItemTemplateEventArgs e) {
        if (e.ModelColumn.PropertyEditorType.IsSubclassOf(typeof(ASPxObjectPropertyEditorBase))) {
            e.CreateDefaultDataItemTemplate = true;
        }
    }
    protected override void OnDeactivated() {
        base.OnDeactivated();
        if (gridListEditor != null) {
            gridListEditor.CreateCustomDataItemTemplate -= gridListEditor_CreateCustomDataItemTemplate;
            gridListEditor = null;
        }
    }
}
See Also