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
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