# TreeView

Adds supports for \[ System.Windows.Forms.TreeView]\(<https://msdn.microsoft.com/en-us/library/system.windows.forms.treeview(v=vs.110).aspx>)

## Implementation  Details:

> **Component Selector:** 'wm-treeview'
>
> **Kendo UI Component:** [Kendo TreeView](https://www.telerik.com/kendo-angular-ui/components/treeview/)

## Class inheritance

TreeViewComponent extends [ControlComponent](/webmap/general/frontend/documentation/winforms-angular-components/web-components/base-components/control-component.md).

## PME Support

### Properties

| Property                             | Get/Set | Notify Changes | Details                                                                                                                                                                         |
| ------------------------------------ | ------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| items: any                           | Yes     | No             | Used to return/set the datasource value.                                                                                                                                        |
| defaultDataUrl: string               | No      | No             | Default URL to call the API and get the data.                                                                                                                                   |
| url: string                          | Get     | No             | Returns the value of the dataUrl if was set, overwise return the defaultDataUrl.                                                                                                |
| expandedKeys: any\[]                 | No      | No             | List of expanded keys on the treeview.                                                                                                                                          |
| disabledKeys: any\[]                 | No      | No             | List of disabled keys on the treeview.                                                                                                                                          |
| checkedKeys: any\[]                  | No      | No             | List of checked keys on the treeview.                                                                                                                                           |
| selectedKey: any\[]                  | No      | No             | Selected key on the treeview.                                                                                                                                                   |
| checkableSettings: CheckableSettings | Get     | No             | Returns the settings for the chechboxes property.                                                                                                                               |
| checkboxes: boolean                  | Yes     | No             | Get/Set the checkboxes property value.                                                                                                                                          |
| selectedNode: any\[]                 | Yes     | Yes            | Get/Set the selectedNode property value.                                                                                                                                        |
| text: string                         | Yes     | Yes            | Inherited from ControlComponent [see ControlComponent](/webmap/general/frontend/documentation/winforms-angular-components/web-components/base-components/control-component.md). |
| name: string                         | Yes     | No             | Inherited from ControlComponent [see ControlComponent](/webmap/general/frontend/documentation/winforms-angular-components/web-components/base-components/control-component.md). |
| enabled: boolean                     | Yes     | No             | Inherited from ControlComponent [see ControlComponent](/webmap/general/frontend/documentation/winforms-angular-components/web-components/base-components/control-component.md). |
| visible: boolean                     | Yes     | No             | Inherited from ControlComponent [see ControlComponent](/webmap/general/frontend/documentation/winforms-angular-components/web-components/base-components/control-component.md). |
| selectedNodeInfo: any\[]             | Yes     | No             | Get/Set the selectedNodeInfo using the kendo treeview required format.                                                                                                          |
| refreshExpandedKeys: bool            | true    | No             | Get/Set the refreshExpandedKeys flag. When true the updateExpandedKeys is triggered.                                                                                            |

### Methods

| Method                   | Supported | Details                                                                                                                                           |
| ------------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| ngOnInit: void           | Yes       | Used to register any function that to be trigger when it initialize.                                                                              |
| updateExpandedKeys: void | Yes       | Used to refresh the expandedkeys collection of a treeView.                                                                                        |
| scrollDelay: void        | Yes       | Used to obtain the ammount of time to wait until an element appears into the DOM to moves the scroll to ensure the visibility. Default value 300. |

### Events

| Event       | Supported | Parameter       | Details                                                                                                                             |
| ----------- | --------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Click       | Yes       | **$event**: any | Trigger Click event. ***$event*** parameter is optional and the ***$event***  object vary depending on the type of DOM event.       |
| DoubleClick | Yes       | **$event**: any | Trigger DoubleClick event. ***$event*** parameter is optional and the ***$event***  object vary depending on the type of DOM event. |
| MouseDown   | Yes       | **$event**: any | Trigger MouseDown event. ***$event*** parameter is optional and the ***$event***  object vary depending on the type of DOM event.   |
| AfterSelect | Yes       | **$event**: any | Trigger AfterSelect event. ***$event*** parameter is optional and the ***$event***  object vary depending on the type of DOM event. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gapvelocity.ai/webmap/general/frontend/documentation/winforms-angular-components/web-components/kendoui-components/treeview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
