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

fireCommand

Method which triggers specific command for the grid when executed. The method is called for the GridTableView client instance and its arguments depend on the command which will be processed.

fireCommand(commandName, commandArgument)
commandNameThe name of the command that will be fired.
commandArgumentThe argument to be passed along with the command.

Example:

JavaScript
function FirePageCommand() {
    var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
    masterTable.fireCommand("Page", "Next");
}

This method can be used to invoke custom commands along with a single string argument which can be accessed later on using the OnItemCommand server event.

When firing custom commands (with a custom command name) they are fired through the first data item in the GridTableView. This means that no command will be fired if the grid is bound to an empty data source.

GridCommandType of object used to invoke the methodfireCommand syntaxeventArgs details
EditGridTableViewfireCommand("Edit", itemIndex)Example: fireCommand("Edit", 0)
UpdateGridTableViewfireCommand("Update", itemIndex)Example: fireCommand("Update", 0)
DeleteGridTableViewfireCommand("Delete", itemIndex)Example: fireCommand("Delete", 0)
InitInsertGridTableViewfireCommand("InitInsert", "")Required but not used. Example: fireCommand("InitInsert", "")
PerformInsertGridTableViewfireCommand("PerformInsert", "")Required but not used. Example: fireCommand("PerformInsert", "")
CancelGridTableViewfireCommand("Cancel", "")Required but not used. Example: fireCommand("Cancel", "")
PageGridTableViewfireCommand("Page", pageCommand)string argument:"First", "Next", "Prev", "Last", numeric values as string presentation. Example: fireCommand("Page", "Next")
SortGridTableViewfireCommand("Sort", sortExpression)string argument: fieldName (mandatory), sortOrder (optional)Example: fireCommand("Sort", "ContactName DESC")
HeaderContextMenuFilterGridTableViewfireCommand("HeaderContextMenuFilter",commandArgs)A string holding the filter conditions data. Example: fireCommand("HeaderContextMenuFilter", "ShipName|?NoFilter||?NoFilter|")
ExportToExcelGridTableViewfireCommand("ExportToExcel", "")Required but not used. Example: fireCommand("ExportToExcel", "")
ExportToWordGridTableViewfireCommand("ExportToWord", "")Required but not used. Example: fireCommand("ExportToWord", "")
ExportToPdfGridTableViewfireCommand("ExportToPdf", "")Required but not used. Example: fireCommand("ExportToPdf", "")
ExportToCsvGridTableViewfireCommand("ExportToCsv", "")Required but not used. Example: fireCommand("ExportToCsv", "")
EditSelectedGridTableViewfireCommand("EditSelected", "")Required but not used. Example: fireCommand("EditSelected", "")
UpdateEditedGridTableViewfireCommand("UpdateEdited", "")Required but not used. Example: fireCommand("UpdateEdited", "")
DeleteSelectedGridTableViewfireCommand("DeleteSelected", "")Required but not used. Example: fireCommand("DeleteSelected", "")
EditAllGridTableViewfireCommand("EditAll", "")Required but not used. Example: fireCommand("EditAll", "")
CancelAllGridTableViewfireCommand("CancelAll", "")Required but not used. Example: fireCommand("CancelAll", "")
GroupGridTableViewfireCommand("GroupByColumn", "")Example: fireCommand("GroupByColumn", "Country")
UnGroupGridTableViewfireCommand("UnGroupByColumn", "")Example:fireCommand("UnGroupByColumn", "Country")
DownloadAttachmentGridTableViewfireCommand("DownloadAttachment", argument)String - collection of key/value pairs in JSON format (seethis demo)Example:var args = '{"FileId":24,"ColumnUniqueName":"AttCol","FileName":"report.doc"}'; fireCommand("DownloadAttachment", args)
ExpandCollapseGridTableViewfireCommand("ExpandCollapse", itemIndex)Example:fireCommand("ExpandCollapse", 0)

The equivalents on the server are listed in this topic from the documentation.

Not finding the help you need?
Contact Support