New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

TreeList Object

Below are listed the properties, methods, collections and events you should be aware of when working with Telerik RadTreeList control.

Server-side Properties

RadTreeList provides the following server-side properties:

 

PropertyDescription
AllowLoadOnDemandGets or sets the value indicating whether the load on demand feature is enabled.
AllowMultiItemEditGets or sets the value indicating whether editing of multiple records at the same time is enabled.
AllowNaturalSortGets or sets the value indicating whether the None mode will be included when toggling the sort modes of the control.
AllowPagingGets or sets the value indicating whether the paging feature is enabled.
AllowRecursiveDeleteGets or sets the value indicating whether the recursive delete feature is enabled.
AllowSortingGets or sets the value indicating whether the sorting feature is enabled.
AllowMultiColumnSortingGets or sets the value indicating whether more than one columns can be sorted in a single radTreeList.The order is the same as the sequence of expressions in SortExpressions.
AllowMultiItemSelectionGets or sets the value indicating whether you will be able to select multiple items in the RadTreeList. By default the property is set to false.
AllowRecursiveSelectionGets or sets the value indicating whether child items will be selected recursively when a RadTreeList item is selected. Setting this property to true automatically enables MultiItemSelection for the RadTreeList. The default value is false.
ClientDataKeyNamesReturns a collection of the client data key names specified for the treelist control.
CurrentPageIndexGets or sets a value indicating the index of the currently active page in case paging is enabled.
DataKeyNamesGets or sets an array of data-field names that will be used to populate the DataKeyValues collection when the RadTreeList control is bound.
DataSourceIsAssignedA boolean property indicating whether a DataSource has been set for the RadTreeList control.
DetailTemplateSets a template which will be used to generate a DetailTemplateItem corresponding to eachTreeListDataItem.
DirGets or sets a value which indicates the direction in which the control will be rendered (RTL/LTR).
EditModeA property used to specify the edit mode of the treelist items, the possible values being(EditForms, InPlace and PopUp).
EnableAriaSupportA boolean property specifying whether WAI-ARIA support should be enabled.
EnableAjaxSkinRenderingGets or sets value indicating whether to render the skin CSS files during Ajax requests.
EnabledGets or sets value indicating whether the control is enabled or not. The default value is true.
EnableNoRecordsTemplateGets or sets value indicating whether a NoRecordsItem will be displayed when the treelist is bound to an empty datasource.
EnableEmbeddedBaseStylesheetGets or sets value indicating whether to render the embedded base stylesheet css file of the control or not.
EnableEmbeddedScriptsGets or sets value indicating whether to render the embedded scripts of the control or not.
EnableEmbeddedSkinsGets or sets value, indicating whether to render the embedded skin css file of the control or not.
EnableViewStateGets or sets value indicating whether the RadTreeList ViewState is enabled or not. The default value is true.
GridLinesGets or sets value indicating whether borders will be displayed when the RadTreeList is rendered. Can be set to "Both" (the default value), "None", "Horizontal" and "Vertical".
HideExpandCollapseButtonIfNoChildrenSpecifies whether the expand collapse button should be hidden when there are no children for a certain item (not compatible with the load-on-demand functionality of the control).
IsItemInsertedIndicates whether a root item is currently being inserted.
LocalizationPathGets or sets a value indicating where the control will look for its .resx localization files.By default these files should be in the App_GlobalResources folder.
NoRecordsTemplateSets a template which will be used to generate a NoRecordsItem when the RadTreeList control is bound to an empty datasource.
NoRecordsTextSets a text which will be displayed inside the NoRecordsItem when the RadTreeList control is bound to an empty datasource.
PageSizeSpecifies the maximum number of items that can appear in a page. The default value is 10.
PageCountGets the number of pages required to display the records of the data source in a RadTreeList control.
PagerTemplateSets a template which will be used for generating the TreeListPagerItem.
ParentDataKeyNamesGets or sets an array of data-field names that will be used to populate the ParentDataKeyValues collection when the RadTreeList control is bound.
ShowOuterBordersGets or sets value indicating whether the control will show outer borders. The default value is true.
ShowTreeLinesGets or sets value indicating whether the control will show outer tree lines. The default value is true.
SkinGets or set the RadTreeList skin
SortingSettings.SortedAscToolTipGets or sets the tooltip that will be displayed when you hover over the sorting button and the column is sorted ascending.
SortingSettings.SortedDescToolTipGets or sets the tooltip that will be displayed when you hover over the sorting button and the column is sorted descending.

ClientSettings

The RadTreeList ClientSettings class contains the following properties used to customize the client-side behavior of the control:

 

PropertyDescription
AllowPostBackOnItemClickGets or sets a value indicating whether RadTreeList should postback on row click.
Scrolling.AllowScrollGets or sets the value indicating whether the scrolling feature is enabled.
Scrolling.SaveScrollPositionGets or sets the value indicating whether the scroll position of the control should be preserved on postback.
Scrolling.ScrollHeightGets or sets the value indicating the height of the items container when scrolling.
Scrolling.ScrollLeftGets or sets the value indicating the treelist's horizontal scroll position.
Scrolling.ScrollTopGets or sets the value indicating the treelist's vertical scroll position.
Scrolling.UseStaticHeadersGets or sets the value indicating whether the static headers feature is enabled.
Selecting.AllowItemSelectionGets or sets a value indicating whether you will be able to select a treelist row on the client by clicking on it with the mouse.
Selecting.AllowToggleSelectionGets or sets a value indicating whether clicking on an item will toggle the item's selected state.
Selecting.UseSelectColumnOnlyGets or sets value indicating whether users could select items on mouse click or forces them to use the TreeListSelectColumn for that purpose. The default value is false.

EditFormSettings

The RadTreeList EditFormSettings class is used to set up the look, edit form modes and behavior of the RadTreeList control when in edit mode, it exposes the following properties:

 

PropertyDescription
CaptionDataFieldSpecifies the data field that will be used to populate the caption of the edit form.
CaptionFormatStringSpecifies the format string used for building the caption of the edit form.
ColumnsCountSpecifies the number of columns in the <table> rendered in the auto-generated edit form.
EditColumnProvides access for modifying the property values of the EditCommandColumn.
EditFormTypeSets the type of the edit form when an item in RadTreeList is edited or inserted. The three options are AutoGenerated , Template and WebUserControl .
FormCaptionStyle / FormMainTableStyle / FormStyle / FormTableAlternatingItemStyle / FormTableButtonRowStyle / FormTableItemStyle / FormTableStyleProperties used to style the respective parts of the auto-generated edit form.
FormTemplateSets a template which will be used to generate the RadTreeList edit/insert form.
InsertCaptionSpecifies a string which will be displayed as a caption in the insert form of the treelist.
PopUpSettings.CloseButtonTooltipSpecifies the text for the tooltip of the pop-up edit form's close button.
PopUpSettings.HeightSpecifies the height of the pop-up edit form.
PopUpSettings.ModalA boolean property controlling whether the pop-up edit form will be modal.
PopUpSettings.ScrollBarsA property controlling which scrollbars will be displayed.
PopUpSettings.ShowCaptionInEditFormA boolean property controlling whether a caption will be displayed in the pop-up edit form.
PopUpSettings.WidthSpecifies the width of the pop-up edit form.
PopUpSettings.ZIndexA property which allows you to specify the z-index of the pop-up edit form.

ExportSettings

The RadTreeList ExportSettings class is used to control the RadTreeList export modes and behavior,it exposes the following properties:

 

PropertyDescription
ExportModeA property which controls which part of the treelist content will be exported.
FileNameA property which specifies the name of the exported file.
IgnorePagingA boolean property controlling whether the whole data from the control's resolved datasource will be exported.
OpenInNewWindowA boolean property controlling whether the newly exported file will be opened in new browser window/tab.
PdfA group of properties used to control the PDF export of RadTreeList. You can find description of them in this help article.

ValidationSettings

The RadTreeList ValidationSettings class is used to configure the RadTreeList validation behavior of the control when editing/inserting records:

 

PropertyDescription
CommandsToValidateAn array of strings used to list the names of the commands which will trigger validation in RadTreeList.
EnableValidationA boolean value indicating whether the treelist values should be validated.
ValidationGroupA property used to set a ValidationGroup for the treelist control, so that it is validated only along a certain group of controls, having the same ValidationGroup name.

Server-side Collections

RadTreeList has the following server-side collections:

 

CollectionReturn typeDescription
AutoGeneratedColumnsTreeListColumn[]A collection of all the auto-generated columns inside RadTreeList.
ClientDataKeyValuesTreeListDataKeyArrayA collection containing the values of the fields specified as ClientDataKeyNames in the RadTreeList declaration.
ColumnsTreeListColumnsCollectionA collection of all the TreeListColumns manually added to the control instance.
DataKeyValuesTreeListDataKeyArrayA collection containing the values of the fields specified as DataKeyNames in the RadTreeList declaration.
EditIndexesTreeListEditIndexesCollectionA collection containing the indexes of all items which are currently in edit mode.
EditItemsTreeListEditItemCollectionA collection of all currently edited items.
ExpandedIndexesTreeListExpandedIndexesCollectionA collection containing the indexes of all rendered items which are currently expanded.
InsertIndexesTreeListEditIndexesCollectionReturns an array containing the indexes of all items which are currently inserted.
InsertItemsTreeListEditItemCollectionReturns a collection of all currently inserted items.
ItemsTreeListDataItemCollectionA collection of all currently rendered TreeListDataItem objects.
ParentDataKeyValuesTreeListDataKeyArrayA collection containing the values of the fields specified as ParentDataKeyNames in the RadTreeList declaration.
SelectedIndexesTreeListDataItemCollection (read-only)A collection containing the indexes of all the selected items in the RadTreeList.
SelectedItemsTreeListDataItemCollection (read-only)A collection containing all TreeListDataItems currently selected.
SortExpressionsTreeListSortExpressionCollectionA collection of the sort expressions generated for the RadTreeList.
RenderColumnsTreeListColumn[]A collection of all the TreeListColumns which will be rendered in the control (including auto-generated ones).

Server-side Methods

RadTreeList provides the following server-side methods:

 

MethodDescription
ApplyRecursiveSelection(TreeListDataItem item, bool selected[optional])Recursively selects or deselects all child items of a RadTreeLIst item specified by its hierarchical index. Updates the selected state of all the parent items of the specified item to reflect the recursive selection.
ClearSelectedItems()Removes all selected items that belongs to RadTreeList instance.
CollapseAllItems()Collapses all RadTreeList items.
ExpandAllItems()Expands all RadTreeList items.
ExpandItemToLevel(TreeListDataItem item, int level)Expands the specified TreeListDataItem to the specified level.
ExpandToLevel(int level)Expands all RadTreeList items to the specified level.
ExtractValuesFromItem(IDictionary newValues, TreeListEditableItem dataItem, bool includePrimaryKey)Fills an IDictionary object with the values of a TreeListEditableItem.
GetItems(TreeListItem Type[])Returns a collection of TreeListItems objects with the specified type.
InsertChildItem(TreeListDataItem parentItem)Inserts a new child item for the TreeListDataItem passed.
InsertItem()Inserts a new root item in RadTreeList.
PerformDelete(TreeListDataItem editedItem)Performs asynchronous delete operation, using the DataSourceControl API, then Rebinds.When the asynchronous operation calls back, RadTreeList will fire ItemDeleted event.
PerformInsert(TreeListEditableItem insertItem)Performs asynchronous insert operation, using the DataSourceControl API, then Rebinds.When the asynchronous operation calls back, RadTreeList will fire ItemInserted event.
PerformUpdate(TreeListEditableItem editedItem)Performs asynchronous update operation, using the DataSource control API and the Rebind method. When the asynchronous operation calls back, RadTreeList will fire ItemUpdated event.

Server-side Events

RadTreeList provides the following server-side events:

 

EventsDescription
AutoGeneratedColumnCreatedFires when auto generated column is created.
CancelCommandFires when an insert or edit action is cancelled.
ChildItemsDataBindFires when load-on-demand is enabled and a TreeListDataItem is being expanded.
CreateColumnEditorFires when when a column editor needs to be initialized.
CreateCustomColumnFires when a custom column is recreated on postback.
DeleteCommandFires when a delete command is triggered.
EditCommandFires when an edit command has been triggered.
ExportingFires when the export output is already generated and ready for adding to the response.
InsertCommandFires when a PerformInsert command is triggered.
ItemCreatedFires when the RadTreeList item is created. In this event you could add controls in the specific TreeListItem and modify the properties to already existing controls.
ItemCommandFires when any command button is clicked in the RadTreeList control. All bubbled events from the treelist items fire the ItemCommand event.
ItemDataBoundFires after an item is databound to the RadTreeList control. In this event you could manipulate the newly added (in the ItemCreated event) controls' properties for instance.
ItemDeletedFires when an item has been deleted from RadTreeList with automatic datasource operations enabled.
ItemDropFires when a TreeListDataItem is dragged and dropped over HTML element.
ItemDropFires when a TreeListDataItem is dragged and dropped over HTML element.
ItemInsertedFires when an item has been inserted in RadTreeList with automatic datasource operations enabled.
ItemInsertedFires when an item has been updated in RadTreeList with automatic datasource operations enabled.
NeedDataSourceFires when the RadTreeList is about to be bound and the data source must be assigned.
PageIndexChangedFires when a paging action is performed.
PageSizeChangedFires when page size is changed.
SelectedIndexChangedFired for both client and server-side item selection on the first post-back following the selection/deselection of the item/items. For example, if you have client-side item selection and you select one or more tree list item,the event will be fired the next time you make a post-back to the server.In the case of server-side item selection, the event will be fired immediately after the selection/deselection of a certain item since that operation automatically triggers a post-back to the server.
PdfExportingFires when the HTML output of the RadTreeList control is generated and before it is parsed into binary. It allows you to manipulate the treelist output when exporting, as in the Export event the pdf is already generated and cannot be modified.
SortingFires when a sort operation is requested and before the RadTreeList control handles the sort operation.
UpdateCommandFires when an Update command is triggered.