Your search did not match any results.

Ribbon

Backend API
@inject IHostingEnvironment env <form id="formExport" method="post"> <input name="SpreadsheetWorkSessionId" type="hidden" value="" /> </form> <script> function onCustomCommandExecuted(s, e) { switch (e.commandName) { case 'save': var spreadsheetState = spreadsheet.getSpreadsheetState(); $.ajax({ type: 'POST', url: '@Url.Action("SaveToFile")', data: { spreadsheetState: spreadsheetState } }); break; case 'download': var spreadsheetState = spreadsheet.getSpreadsheetState(); $("#formExport").attr('action', '@Url.Action("DownloadXlsx")'); $("input[name='SpreadsheetWorkSessionId']").val(spreadsheetState.SpreadsheetWorkSessionId); $("#formExport").submit(); break; } } </script> @{ var documentPath = System.IO.Path.Combine( env.ContentRootPath, DirectoryManagmentUtils.GetDocumentSampleFolderPath(Context), "UICustomization.xlsx"); } @(Html.DevExpress() .Spreadsheet("spreadsheet") .Height("500px") .Width("100%") .Ribbon(ribbon => ribbon .Visible(true) .ActiveTabIndex(1) .Tabs(tabs => { tabs.Clear(); tabs.Add() .Title("File") .Items(items => { items.AddButton() .Text("Save") .CommandName("save") .ShowText(true) .Icon("save"); items.AddButton() .Text("Download as Xlsx") .CommandName("download") .ShowText(true) .Icon("download"); items.AddPrintItem().BeginGroup(true); }); tabs.AddHomeTab() .Items(items => { items.Clear(); items.AddUndoItem(); items.AddRedoItem(); items.AddCutItem(); items.AddCopyItem(); items.AddPasteItem(); }); }) ) .ClientSideEvents(events => { events.OnCustomCommandExecuted("onCustomCommandExecuted"); }) .ConfirmOnLosingChanges(confirm => confirm.Enabled(false)) .DocumentRequestHandlerUrl(Url.Action("DxDocumentRequest")) .Open(documentPath) )
using DevExpress.AspNetCore.Spreadsheet; using DevExpress.Spreadsheet; using DevExpress.XtraSpreadsheet.Export; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using System; using System.IO; using System.Linq; using System.Text; namespace AspNetCoreDemos.Spreadsheet { [Route("[action]")] public class SpreadsheetController : Controller { public ActionResult RibbonCustomization() { return View(); } } }