Posted 26 January 2023, 12:26 am EST - Updated 26 January 2023, 12:31 am EST
Hi all,
We are using GrapeCity.Documents.Excel 4.2.6 in a .Net 7.0 library project.
We tried to add a filter to one of our documents but it seems like the way you describe it in the docs does not work for us.
I just tried it with your given code in the docs: https://www.grapecity.com/documents-api-excel/demos/createfilterwithoutcondition
//create a new workbook
var workbook = new GrapeCity.Documents.Excel.Workbook();
IWorksheet worksheet = workbook.Worksheets[0];
object[,] data = new object[,]{
{"Name", "City", "Birthday", "Eye color", "Weight", "Height"},
{"Richard", "New York", new DateTime(1968, 6, 8), "Blue", 67, 165},
{"Nia", "New York", new DateTime(1972, 7, 3), "Brown", 62, 134},
{"Jared", "New York", new DateTime(1964, 3, 2), "Hazel", 72, 180},
{"Natalie", "Washington", new DateTime(1972, 8, 8), "Blue", 66, 163},
{"Damon", "Washington", new DateTime(1986, 2, 2), "Hazel", 76, 176},
{"Angela", "Washington", new DateTime(1993, 2, 15), "Brown", 68, 145}
};
worksheet.Range["A1:F7"].Value = data;
worksheet.Range["A:F"].ColumnWidth = 15;
//Create filters whithout condition.
worksheet.Range["A1:F7"].AutoFilter();
// Save to an excel file
workbook.Save("CreateFilterWithoutCondition.xlsx");
if i run the code snippet on your website it looks correct:
If i run this code locally it looks like this:
Do you know why that might be?
Kind regards
Maya