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

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

CreateCustomDataItemTemplateEventArgs.CreateDefaultDataItemTemplate Property

Specifies if the default data item template should be created.

Namespace: DevExpress.ExpressApp.Web.Editors.ASPx

Assembly: DevExpress.ExpressApp.Web.v24.2.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