0
I’m implementing a functionality in a project using Asp.net mvc and I’m trying to remove some columns from a gridview that I created in my application, the gridview datasource is a table in the database, but I want to remove some columns from the table, because I am trying to export this data to an excel file and some table items like the primary key are not required. How do I remove the columns from my gridview choice? I’ve tried things like:
gv.Columns.Remove("ArquivoExcelId");
also tried to:
gv.Columns[0].Visible = false;
but the 2 generated error, as if the past parameters were incomparable or something like, someone knows how to do this?
Which error does it generate? which code are you using to generate excel?
– PauloHDSousa
If it is Asp.net mvc you will not be able to do this via server side code. Try to hide the column using jquery.
– Anderson Ribeiro