hi,
I need to change background and color of nodes based on node property.
How can I do?
regards
alessandro
|
@using Syncfusion.Blazor.Navigations
<SfTreeView TValue="MailItem">
<TreeViewFieldsSettings TValue="MailItem" Id="Id" DataSource="@MyFolder" Text="FolderName" HtmlAttributes="HtmlAttributes" ParentID="ParentId" HasChildren="HasSubFolders" Expanded="Expanded"></TreeViewFieldsSettings>
</SfTreeView>
<style>
.e-custom .e-list-text {
color: #ff0000;
}
.e-list-item .e-custom .e-fullrow {
background: #e06b8645;
}
.e-custom.e-hover > .e-text-content .e-list-text {
color: #ff0000;
}
</style>
@code{
protected override void OnInitialized()
{
base.OnInitialized();
. . . .
MyFolder.Add(new MailItem
{
Id = "3",
ParentId = "2",
FolderName = "Primary",
HtmlAttributes= new Dictionary<string, object>()
{
{"class", "e-custom e-tree-class" }
}
});
MyFolder.Add(new MailItem
{
Id = "4",
ParentId = "2",
FolderName = "Social",
HtmlAttributes = new Dictionary<string, object>()
{
{"class", "e-custom e-tree-class" }
}
});
}
} |
hi, it’s ok for me!
regards
alessandro