If it's grid used with server binding, it is not possible to use Client Event OnDataBound showed here: http://demos.telerik.com/aspnet-mvc/razor/grid/customcommand (thanks to ataravati's comment)
However, event OnLoad will be fired.
Solution can look like:
In cshtml:
t.Custom().HtmlAttributes(new { id = "export" }).
Text("Export").Action("Export", "Home", new { page = 1, orderBy = "~", filter = "~" });
.ClientEvents(events => events.OnLoad("OnLoad"))
<script type="text/javascript">
function OnLoad() {
var grid = $(this).data('tGrid');
// Get the export link as jQuery object
var $exportLink = $('#export');
// Get its 'href' attribute - the URL where it would navigate to
var href = $exportLink.attr('href');
// Update the 'page' parameter with the grid's current page
href = href.replace(/page=([^&]*)/, 'page=' + grid.currentPage);
// Update the 'orderBy' parameter with the grids' current sort state
href = href.replace(/orderBy=([^&]*)/, 'orderBy=' + (grid.orderBy || '~'));
// Update the 'filter' parameter with the grids' current filtering state
href = href.replace(/filter=(.*)/, 'filter=' + (grid.filterBy || '~'));
// Update the 'href' attribute
$exportLink.attr('href', href);
}
</script>
In Controler
public ActionResult Export(int page, string orderBy, string filter)
{
IEnumerable orders = GetOrders().AsQueryable().ToGridModel(page, 10, orderBy, string.Empty, filter).Data;
}