DxTreeViewDataMappingBase.Attributes Property
Specifies HTML attributes of a TreeView node. Map this property to a data source field.
Namespace: DevExpress.Blazor.Base
Assembly: DevExpress.Blazor.v26.1.dll
Declaration
[DefaultValue(null)]
[Parameter]
public string Attributes { get; set; }
Property Value
| Type | Default | Description |
|---|---|---|
| String | null | The field name. |
Remarks
The following code snippet maps the HtmlAttributes data source field to DxTreeViewNode HTML attributes:
<DxTreeView Data="@Departments">
<DataMappings>
<DxTreeViewDataMapping Children="Children"
Text="Name"
Attributes="HtmlAttributes" />
</DataMappings>
</DxTreeView>
@code {
List<Department> Departments { get; set; } = new() {
new Department {
Name = "Engineering",
HtmlAttributes = new Dictionary<string, object> { ["id"] = "SOFT-ENG" },
Children = new() {
new Department { Name = "Backend" },
new Department { Name = "Frontend" }
}
},
new Department { Name = "Marketing" }
};
}
See Also