ClosedXML Excel File

Aug 14, 2013 at 4:46 AM
I am using ClosedXML dll for exporting the Datatable content to a Excel file using .NET 4.0 . When i open the Excel file after exporting data, 1st row data are displayed with a dropdown menu for sort operation automatically.

How do i remove the dropdown menus from displaying automatically, I dont need them.
Coordinator
Aug 14, 2013 at 4:58 AM
worksheet.Tables.First().AutoFilter.Enabled = false;
Aug 14, 2013 at 5:12 AM
XLWorkbook wb = new XLWorkbook();
                
                foreach (DataTable dt in ds1.Tables)
                {
                    if (dt.Rows.Count > 0)
                        wb.Worksheets.Add(dt, dt.Rows[0]["TITLE"].ToString());
                }
Im using above code to add worksheet for each datatable in a dataset. I can't able to add the
worksheet..Tables.First().AutoFilter.Enabled = false;

where should i add the line?

Thnx for quick reply.. :)
Aug 14, 2013 at 5:22 AM
Edited Aug 14, 2013 at 5:25 AM
If i use ShowAutoFilter like this
XLWorkbook wb = new XLWorkbook();
wb.Worksheets.First().Tables.First().ShowAutoFilter = false;
I got the result for first sheet. But for the other sheets i add it shows the dropdown...
Pls help
Coordinator
Aug 15, 2013 at 2:23 AM
Iterate through the rest of the sheets?