Class DropDownTreeField<TItem>
A class used for configuring the Dropdown Tree fields setting properties.
Inherited Members
Namespace: Syncfusion.Blazor.Navigations
Assembly: Syncfusion.Blazor.dll
Syntax
public class DropDownTreeField<TItem> : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Type Parameters
| Name | Description |
|---|---|
| TItem | Specifies the type of DropDownTreeField<TItem>. |
Constructors
DropDownTreeField()
Declaration
public DropDownTreeField()
Properties
Child
Gets or sets the string value that represents the name of the child data source holding a list of objects.
Declaration
[Parameter]
public string Child { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The value denotes the name of child data in assigned data source. The default value is |
Examples
@using Syncfusion.Blazor.DropDowns
<SfDropDownTree TItem="string" TValue="TreeItem">
<DropDownTreeField TItem="string" DataSource="TreeDataSource" Id="NodeId" Text="NodeText" Expanded="Expanded" Child="@("Child")"></DropDownTreeField>
</SfDropDownTree>
@code {
List<TreeItem> TreeDataSource = new List<TreeItem>();
protected async override Task OnInitializedAsync()
{
await base.OnInitializedAsync();
TreeDataSource.Add(new TreeItem
{
NodeId = "01",
NodeText = "Local Disk (C:)",
Expanded = true,
Child = new List<TreeItem>()
{
new TreeItem { NodeId = "01-01", NodeText = "Program Files",
Child = new List<TreeItem>()
{
new TreeItem { NodeId = "01-01-01", NodeText = "Windows NT" },
new TreeItem { NodeId = "01-01-02", NodeText = "Windows Mail" },
},
},
},
});
}
public class TreeItem
{
public string NodeId { get; set; }
public string NodeText { get; set; }
public string Icon { get; set; }
public bool Expanded { get; set; }
public bool Selected { get; set; }
public List<TreeItem> Child { get; set; }
}
}
DataManager
The DataManager class provides functionality for performing data operations in applications. It serves as an abstraction layer for working with remote data sources.
Declaration
public DataManager DataManager { get; set; }
Property Value
| Type | Description |
|---|---|
| DataManager | Map the remote data details for the component using this property. |
DataSource
Gets or sets the data source for rendering the DropDownTree component. The data source value can be of any type that implements IEnumerable.
Declaration
[Parameter]
public IEnumerable<TItem> DataSource { get; set; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<TItem> | The value can be any IEnumerable list of data. The default value is |
Expanded
Gets or sets the mapping field for the expand state of the tree node in the popup.
Declaration
[Parameter]
public string Expanded { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
|
HasChildren
Gets or sets the mapping field for determining whether a node has child nodes or not.
Declaration
[Parameter]
public string HasChildren { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
|
HtmlAttributes
Gets or sets the mapping field for adding custom HTML attributes to the tree node in the popup.
Declaration
[Parameter]
public string HtmlAttributes { get; set; }
Property Value
| Type | Description |
|---|---|
| string | Specifies the additional attribute to be added for the required tree nodes. |
Examples
@using Syncfusion.Blazor.Navigations
<SfDropDownTree TItem="EmployeeData" TValue="string" Width="100%" CssClass="custom" Placeholder="Select an employee" PopupHeight="250px">
<DropDownTreeField TItem="EmployeeData" DataSource="Data" Id="Id" Text="Name" HasChildren="HasChild" ParentID="PId" HtmlAttributes="htmlAttribute"></DropDownTreeField>
</SfDropDownTree>
@code {
public class EmployeeData
{
public string Id { get; set; }
public string Name { get; set; }
public string Job { get; set; }
public string Image { get; set; }
public bool HasChild { get; set; }
public bool Expanded { get; set; }
public string Status { get; set; }
public string PId { get; set; }
public Dictionary<string, object> htmlAttribute { get; set; }
}
List<EmployeeData> Data = new List<EmployeeData>
{
new EmployeeData() {Id="1", Name = "Steven Buchanan", Job = "General Manager", Image= "10",HasChild=true,Expanded=true,Status="busy",htmlAttribute=new Dictionary<string, object>() { {"style", "background-color: yellow;"}, } },
new EmployeeData() {Id="2",PId="1", Name = "Laura Callahan", Job = "Product Manager", Image= "2",HasChild=true,Status="online" }
};
}
ID
Gets or sets the Id field mapped in the dataSource.
Declaration
[Parameter]
public string ID { get; set; }
Property Value
| Type | Description |
|---|---|
| string | Specifies the id field of tree node. The default value is |
IconCss
Gets or sets the mapping field for the icon class of each tree node, which will be added before the node's text.
Declaration
[Parameter]
public string IconCss { get; set; }
Property Value
| Type | Description |
|---|---|
| string | Specifies the CSS class names to render icons for tree nodes. |
ImageUrl
Gets or sets the mapping field for the image URL of each tree node, where the image will be added before the node's text in the popup.
Declaration
[Parameter]
public string ImageUrl { get; set; }
Property Value
| Type | Description |
|---|---|
| string | Specifies the url for the image that must be loaded in the required tree node. |
IsChecked
Gets or sets the field for the checked state of the tree node in the popup.
Declaration
[Parameter]
public string IsChecked { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The checked state of tree node during initial rendering. The default value is |
ParentID
Gets or sets the parent ID field mapped in the dataSource.
Declaration
[Parameter]
public string ParentID { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The parent ID of the corresponding node to which the node must be mapped as children. The default value is |
Query
Gets or sets the query to select particular data from the dataSource.
Declaration
[Parameter]
public Query Query { get; set; }
Property Value
| Type | Description |
|---|---|
| Query | The set of data that must be queried from the entire data source. The default value is |
Selected
Gets or sets the mapping field for the selected state of the tree node.
Declaration
[Parameter]
public string Selected { get; set; }
Property Value
| Type | Description |
|---|---|
| string | Specifies the selected state of node during initial rendering. The default value is |
TableName
Gets or sets the table name used to fetch data from a specific table in the server.
Declaration
[Parameter]
public string TableName { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The table name to fetch data. |
Text
Gets or sets the mapping field for the text displayed as the tree node's display text.
Declaration
[Parameter]
public string Text { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The text to be displayed in tree node. |
Tooltip
Gets or sets the mapping field for the tooltip that will be displayed as hovering text of the tree node.
Declaration
[Parameter]
public string Tooltip { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The tooltip that must be shown during node hover. |
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderTreeBuilder | __builder |
Overrides
Dispose(bool)
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
Overrides
OnInitializedAsync()
Declaration
protected override Task OnInitializedAsync()
Returns
| Type |
|---|
| Task |
Overrides
OnParametersSetAsync()
Declaration
protected override Task OnParametersSetAsync()
Returns
| Type |
|---|
| Task |