This subject was discussed in
File reference from component.
Note that in Jeff's code:
whenSelected(currentFolder.fullPath, grid.getSelectedFirstRow().cells[nameColumn.index],currentFolder.rootFolderID);
He gets only the first selected item with grid.getSelectedFirstRow().cells[nameColumn.index]
You can obtain all the selected items with this loop
for (var key in grid.selectedRows)
grid.selectedRows[key].cells[nameColumn.index];
So you can modify Jeff's code in this way:
var selectedItems = "";
for (var key in grid.selectedRows)
selectedItems += grid.selectedRows[key].cells[nameColumn.index] + "," ;
whenSelected(currentFolder.fullPath, selectedItems,currentFolder.rootFolderID);
Note that we build selectedItems string by combining all the selected items with comma ",". So on the server side, you will need to split this string to have an array of selected items. You can use string.Split method with RemoveEmptyEntries option to build the array:
string[] itemsArray = postedString.Split(new Char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);