0

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);
Jason Aller
  • 3,541
  • 28
  • 38
  • 38
gog
  • 11,788
  • 23
  • 67
  • 129
  • Have you checked the [demos](https://demos.devexpress.com/MVCxGridViewDemos/Exporting/Export)? – Zabavsky Feb 17 '14 at 13:24
  • @Zabavsky yes of course. But some demos of devexpress MVC are just confuse. It not covers directly the point. Other example is the demo of the ribbon in the devexpress MVC kit, they dont mention how or if is possible to fire a action on server side when clicking a ribbon button. – gog Feb 17 '14 at 14:37

0 Answers0