1

I have data in Grid.MVC and now I want export data after filtered or sorted. I don't know how to do it.

Please help me.

Thank all.

I need to export the data in Grid.MVC to Excel. I used the solution in this link: http://www.adambielecki.com/2013/05/exporting-data-to-excel-and-csv-in.html

It working but i have a problem, i want export data after filted or sorted.

1 Answer 1

1

So heres the help I can give you... I had to do this a few years ago with the same technology. Think of the Grid.MVC filtering as "client side". On the server's point of view, the bucket of objects filling the table has not changed when you do filtering, so what I had to do was hook into the filterboxes on the top of the grid by their css names and use a post back of filter objects to the viewbag which were then used in a linq query to filter the objects to the set I desired, from there I was able to export. This was super hard, and I cant access any of my old code b/c it was for a different company.

I would suggest not puttin the effort in, see if your users are okay with "post filtering" since excel is pretty much made to filter / sort data anyways.

Sorry I could not be more help but I hope this gets you started. good luck.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.