I have a project using ASP.NET MVC 5 with Devexpress tools.
In some controller in the Index action I call a view which calls a partial view rendering a GridView. I need to export the gridview data calling a action. So in the index view I create a post which calls the Export ActionResult, but devexpress export action requires two parameters:
(GridViewSettings settings, object dataObject)
But I can't figure out how to get those parameters from the partialview that contains the grid.
<div>
@Html.DevExpress().Ribbon(settings =>
{
settings.ShowFileTab = false;
settings.Name = "ribbon";
var tab = settings.Tabs.Add("Home");
var tasksGroup = tab.Groups.Add("Home");
tasksGroup.Items.Add(MVCxRibbonItemType.ButtonItem, i =>
{
i.Text = "XLS";
i.Name = "exportToXls";
});
}).GetHtml()
</div>
@Html.Partial("_ProdutoMasterGrid", Model);