MVCGrid.Net icon indicating copy to clipboard operation
MVCGrid.Net copied to clipboard

How to exclude column from export

Open pratikdhavale opened this issue 7 years ago • 4 comments

I need to exclude particular column from export like csv file. Currently there is no any configuration exists. Please help me.

pratikdhavale avatar Sep 25 '17 14:09 pratikdhavale

I have implemented some stuff by using reflections to exclude particular column from extract like csv, tsv etc. Soon I will commit the changes. If any one wants email me [email protected]

pratikdhavale avatar Sep 26 '17 05:09 pratikdhavale

For code changes please go to https://pratikdhavale.wordpress.com/2017/12/24/mvcgrid-net-exclude-column-from-export/. Suggestions always welcome. Please reply me if you have any queries.

pratikdhavale avatar Dec 24 '17 13:12 pratikdhavale

I had the same issue, I replaced the original export rendering with a custom one before I started. So I just named the columns I wanted to exclude with a name starting with Action, set the Header text to anything you want.
.RemoveRenderingEngine("export") .AddRenderingEngine("export", typeof(TabDelimitedRenderingEngine)) .WithAuthorizationType(AuthorizationType.AllowAnonymous) .AddColumns(cols => { cols.Add("Action1").WithHeaderText("")

Then on the RenderingEngine, I excluded any column that started with the word Action

anlebu avatar Apr 13 '18 14:04 anlebu

Thanks @anlebu, great solution. You save me many work ;)

EligioMH avatar Jul 10 '20 12:07 EligioMH