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

TreeListDataItem Object

Below are listed the properties, methods and collections you should be aware of when working with TreeListDataItem object.

Server-side Properties and Collections

TreeListDataItem provides the following server-side properties:

 

PropertyDescription
CanExpandReturns a boolean value indicating whether the current item can be expanded (has child items).
CanExtractValuesReturns a boolean value indicating whether data values can be extracted from the current item.
ChildItemsA collection of the TreeListDataItems which are children to the current item.
DataItemReturns the underlying data object to which the TreeListDataItem object is bound.Available only during and after the ItemDataBound event.
DataItemIndexReturns the index of the current item's corresponding record inside the treelist datasource.
DetailItemReturns the TreeListDetailItem corresponding to the current item.
DisplayIndexReturns the index of the current item in the treelist, regardless of the items hierarchy.
EditGets or sets a value indicating whether the current item should be edited.
EditFormItemReturns the TreeListEditFormItem corresponding to the current item.
ExpandedA boolean value indicating whether the current item is expanded.
HierarchyIndexA complex index composed of two parts - NestedLevel , indicating on which level of the treelist hierarchy is the current item, and LevelIndex which indicates the position of the item in this level.
InsertItemReturns a TreeListEditableItem object which is the inserted (child) item corresponding to the current item.
IsChildItemInsertedA boolean value indicating whether a child item is currently being inserted for the item.
IsInEditModeA boolean value indicating whether the item is currently in edit mode.
OwnerTreeListReturns the RadTreeList object to which the current item belongs.
ParentItemReturns TreeListItem which is a parent to the current item in the treelist hierarchy.
SavedOldValuesA collection of type IDictionary used while the item is being edited to provide its original values before the current edit operation.
SelectedA boolean value indicating whether item is currently selected.

Server-side Methods

TreeListDataItem provides the following server-side methods:

 

MethodDescription
ExtractValues(IDictionary newValues)Fills an IDictionary object with the values of the current item (applicable when the item is in edit mode).
FireCommandEvent(string eventName, string eventArgs)Fires a command with the name and arguments provided, which results in the ItemCommand event firing.
GetColumnEditor(TreeListEditableColumn editableColumn)Returns the editor control for the provided column when the current item is in edit mode.
GetDataKeyValue(string keyName)Returns the value of the data field provided as a DataKeyName corresponding to the current item.
GetParentDataKeyValue(string keyName)Returns the value of the data field provided as a ParentDataKeyName corresponding to the current item.
InsertChildItem()Inserts a new child item for the current item.
UpdateValues(object objectToUpdate)Extracts values for each column, using FillValues(IDictionary, GridEditableItem) and updates values in provided object.