您好,
可以使用以下代码实现- fpSpread1.Sheets[0].Cells[0, 1].Value = 30;
- fpSpread1.Sheets[0].Cells[1, 1].Value = 15;
- fpSpread1.Sheets[0].Cells[2, 1].Value = 10;
- FarPoint.Win.Spread.FilterItemValue test = new FarPoint.Win.Spread.FilterItemValue("30");
- FarPoint.Win.Spread.FilterItemValue test1 = new FarPoint.Win.Spread.FilterItemValue("15");
- FarPoint.Win.Spread.MultiValuesFilterItem multifilter = new FarPoint.Win.Spread.MultiValuesFilterItem(new FarPoint.Win.Spread.FilterItemValue[] { test, test1 });
- FarPoint.Win.Spread.IRowFilter rowFilter = new FarPoint.Win.Spread.HideRowFilter(fpSpread1.ActiveSheet);
- FarPoint.Win.Spread.FilterColumnDefinition fd = new FarPoint.Win.Spread.FilterColumnDefinition(1, FarPoint.Win.Spread.FilterListBehavior.Custom);
- fd.Filters.Add(multifilter);
- rowFilter.ColumnDefinitions.Add(fd);
- fpSpread1.ActiveSheet.RowFilter = rowFilter;
- fpSpread1.ActiveSheet.AutoFilterColumn(1, multifilter.DisplayName, 0);
- fpSpread1.ActiveSheet.AutoFilterMode = FarPoint.Win.Spread.AutoFilterMode.EnhancedContextMenu;
复制代码 |