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 Edit/Update/Delete/Sort/Page/etc.) in code rather than clicking buttons which are placed inside RadListView. For such type of situations Telerik RadListView exposes the FireCommandEvent(eventName, eventArgs) method which can be called from all RadListView items that inherit from RadListViewItem class.

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

RadListView commandType of item used
to invoke the method
FireCommandEvent syntaxeventArgs details
RadListViewEditableItem, RadListViewDataItemFireCommandEvent("Edit", RadListViewCommandEventArgs)Required but not used
Example: FireCommandEvent("Edit", String.Empty)
UpdateRadListViewEditableItem, RadListViewDataItemFireCommandEvent("Update", RadListViewCommandEventArgs)Required but not used
Example: FireCommandEvent("Update", String.Empty)
DeleteRadListViewDataItemFireCommandEvent("Delete", RadListViewCommandEventArgs)Required but not used
FireCommandEvent("Delete", String.Empty)
InitInsertRadListViewEditableItem, RadListViewDataItem,RadListViewItemFireCommandEvent("InitInsert", RadListViewCommandEventArgs)Required but not used
FireCommandEvent("InitInsert", String.Empty)
PerformInsertRadListViewEditableItem,RadListViewDataItem,RadlListViewInsertItemFireCommandEvent("PerformInsert", RadListViewCommandEventArgs)Required but not used
Example: FireCommandEvent("PerformInsert", String.Empty)
CancelRadListViewEditableItem,RadListViewDataItemFireCommandEvent("Cancel", RadListViewCommandEventArgs)Required but not used
Example: FireCommandEvent("Cancel", String.Empty)
PageRadListViewItemFireCommandEvent("Page", RadListViewPageChangedEventArgs)string argument: "First", "Next", "Prev", "Last", numeric values as string presentation
Example: FireCommandEvent("Page", "Next")
SortRadListViewItemFireCommandEvent("Sort", RadListViewSortEventArgs)string argument: fieldName (mandatory), sortOrder (optional)
Example: FireCommandEvent("Sort", "ContactName")
SelectRadListViewDataItemFireCommandEvent("Select", RadListViewSelectCommandEventArgs)Required but not used
Example: FireCommandEvent("Select", String.Empty)
DeselectRadListViewDataItemFireCommandEvent("Deselect", RadListViewDeselectCommandEventArgs)Required but not used
Example:FireCommandEvent("Deselect", String.Empty)
RebindRadListViewItemFireCommandEvent("Rebind", RadListViewCommandEventArgs)Required but not used
Example: FireCommandEvent("Rebind", String.Empty)
ChangePageSizeRadListViewItemFireCommandEvent("ChangePageSize", RadListViewPageSizeChangedEventArgs)string argument: where is valid numeric value
Example: FireCommandEvent("ChangePageSize", 15)
Not finding the help you need?
Contact Support