Вопрос

I have an auto filter set on a range of cells in excel, however i want to be able to choose the drop down criteria too.

//Autofilter Cells
IRange fundfilter = prodworkbook.Worksheets["Funds"].Cells["A4:L2000"];
fundfilter.AutoFilter();

The auto filter method adds the filter to the data, but i want to be able to select a criteria of say "Hedge funds" to column C's filter. Is this possible? Language C#, using Spreadsheet gear framework.

Это было полезно?

Решение

Note that the IRange.AutoFilter() method is overloaded, which provides the extra parameters you'd need to do this. Example:

fundfilter.AutoFilter(2, "Hedge funds", AutoFilterOperator.Or, null, true);

See the following Silverlight sample for more examples of using this auto filter API: http://www.spreadsheetgear.com/support/samples/silverlight.aspx?InitSample=SilverlightSamples.Range.AutoFilterSample

The SpreadsheetGear for .NET and SpreadsheetGear for Silverlight products share much of the same underlying core APIs, so this example is relevant for either products.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top