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

Firing Command Events from Code

In some specific cases you may want to raise command events (like Select/Sort/Page/etc.)in code rather than clicking buttons which are placed inside RadTreeList. For such type of situations TelerikRadTreeList exposes the FireCommandEvent(eventName, eventArgs) method which can be called from the items related to the respective operation.

The table below explains the parameters which you can pass to that method to fire corresponding commands:

RadTreeList commandType of item used to invoke the methodFireCommandEvent syntaxeventArgs details
RebindTreeListItemFireCommandEvent("Rebind", TreeListCommandEventArgs)Required but not used Example: FireCommandEvent("Rebind", String.Empty)
ExpandCollapseTreeListDataItemFireCommandEvent("ExpandCollapse", TreeListCommandEventArgs)Required but not used Example: FireCommandEvent("ExpandCollapse", String.Empty)
EditTreeListDataItemFireCommandEvent("Edit", TreeListCommandEventArgs)Required but not used Example: FireCommandEvent("Edit", String.Empty)
InitInsertTreeListDataItem, TreeListHeaderItemFireCommandEvent("InitInsert", TreeListCommandEventArgs)Required but not used Example: FireCommandEvent("InitInsert", String.Empty)
CancelTreeListDataItemFireCommandEvent("Cancel", TreeListCommandEventArgs)Required but not used Example: FireCommandEvent("Cancel", String.Empty)
UpdateTreeListDataItemFireCommandEvent("Update", TreeListCommandEventArgs)Required but not used Example: FireCommandEvent("Update", String.Empty)
PerformInsertTreeListDataItem, TreeListHeaderItemFireCommandEvent("PerformInsert", TreeListCommandEventArgs)Required but not used Example: FireCommandEvent("PerformInsert", String.Empty)
DeleteTreeListDataItemFireCommandEvent("Delete", TreeListCommandEventArgs)Required but not used Example: FireCommandEvent("Delete", String.Empty)
SortTreeListHeaderItemFireCommandEvent("Sort", TreeListSortEventArgs)string argument: fieldName (mandatory), sortOrder (optional) Example: FireCommandEvent("Sort", "ContactName")
PageTreeListPagerItemFireCommandEvent("Page", TreeListPageChangedEventArgs)string argument: "First", "Next", "Prev", "Last", numeric values as string representation Example: FireCommandEvent("Page", "Next")
SelectTreeListDataItemFireCommandEvent("Select", TreeListSelectEventArgs)Required but not used Example: FireCommandEvent("Select", String.Empty)
DeselectTreeListDataItemFireCommandEvent("Deselect", TreeListDeselectEventArgs)Required but not used Example: FireCommandEvent("Deselect", String.Empty)

Note that if you have AllowRecursiveSelection="true" the current item and all its child items will be selected.

Note that if you have AllowRecursiveSelection="true" the current item and all its child items will be deselected.

Not finding the help you need?
Contact Support