CreateCustomDataItemTemplateEventArgs.CreateDefaultDataItemTemplate Property

Specifies if the default data item template should be created.

Namespace: DevExpress.ExpressApp.Web.Editors.ASPx

Assembly: DevExpress.ExpressApp.Web.v18.2.dll

Declaration

public bool CreateDefaultDataItemTemplate { get; set; }
Public Property CreateDefaultDataItemTemplate As Boolean

Property Value

Type Description
Boolean

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

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