문제

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