Exporting Grid Data

Aug 23, 2013 at 6:39 AM
How can we export all the grid data(rows) to word, pdf or excel.Is there any provision to do so?
Coordinator
Aug 23, 2013 at 6:45 AM
Hi,

This functionally doesn't refer to the grid. You need to use other solutions for that.
Please see: https://gridmvc.codeplex.com/discussions/438349
Aug 23, 2013 at 7:54 AM
okk thanks buddy,,How can i access grid from ma code behind.i want to set data source of grid in ma code behind not in view.
Coordinator
Aug 23, 2013 at 7:56 AM
At first: you need to pass you data to the view. Please see quick start https://gridmvc.codeplex.com/wikipage?title=Quick%20start&referringTitle=Documentation
Aug 23, 2013 at 8:05 AM
I am displaying a grid on ma page.Then I am searching based on diff.-2 filters.All search depends on stored procedures of ma database.So i have to set new datasource again and again.Is that possible?
Coordinator
Aug 23, 2013 at 8:41 AM
If you pass a new collection to the view - grid renders new data
Aug 23, 2013 at 11:09 AM
thanks buddy,,really a wonderful grid
one more query,i have to use ienumerable when m using grid in view.But when i do that,then m not able to access class prop.
e.g in ma case m doing dis-:@model IEnumerable<Audit_Management.Models.AuditReport>
I want to show user form with diff razor controls and a grid on same page.But to bind razor controls with AuditReport class properties,i have to use Audit_Management.Models.AuditReport.How can i use both grid as well as razor controls outside the grid on same page.
Coordinator
Aug 23, 2013 at 11:20 AM
Are you want to display info from selected report?
Aug 23, 2013 at 11:30 AM
just like that,i have a grid and i want to use drop down filters(razor syntax) on same grid.How can i use both grid and drop down list on same page.
Aug 23, 2013 at 11:31 AM
drop down list is bind to class prop and grid is bind to list.how can i use both of them on same page.
Coordinator
Aug 26, 2013 at 5:45 AM
Hi, I can't understand what you mean. Can you provider some screens?

If you want to render some controls, like dropdown, in the grid, please see: https://gridmvc.codeplex.com/wikipage?title=Render%20button%2c%20checkbox%20etc%20in%20the%20grid%20cell&referringTitle=Documentation
Aug 27, 2013 at 10:15 AM
m doing dis

columns.Add(o => o.Status)
        .Titled("Status")
        .Encoded(false)
        .Sanitized(false)
        .SetWidth(110).RenderValueAs(o=>Html.DropDownListFor(o.Status.Status_Name,o.StatusSelectList,o.Status.Status_Name));
but this error comes

he type arguments for method 'System.Web.Mvc.Html.SelectExtensions.DropDownListFor<TModel,TProperty>(System.Web.Mvc.HtmlHelper<TModel>, System.Linq.Expressions.Expression<System.Func<TModel,TProperty>>, System.Collections.Generic.IEnumerable<System.Web.Mvc.SelectListItem>, object)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
Coordinator
Aug 27, 2013 at 3:32 PM
Compiler can't choose the overload method of Html.DropDownListFor. Try to specify arguments explicitly
Oct 31, 2014 at 10:32 AM
Edited Oct 31, 2014 at 10:32 AM
Hi, is there a way to have the filtered records via an object (Like a dataset or ...)? Then I can use the dataset for exporting to Excel for example. Thanks!