问题描述:如何自定义过滤项
问题解答:Spread提供了CustomFilter 类来自定义过滤条件。
关键代码:
- FarPoint.Win.Spread.FilterColumnDefinition fcd1 = new FarPoint.Win.Spread.FilterColumnDefinition(0, FarPoint.Win.Spread.FilterListBehavior.Custom);
- CustomFilter _cFilter = newCustomFilter(fpSpread1.ActiveSheet, "自定义条件1");
- fcd1.Filters.Add(_cFilter);
- CustomFilter _cFilter1 = newCustomFilter(fpSpread1.ActiveSheet, "自定义条件2");
- fcd1.Filters.Add(_cFilter1);
- sf.AddColumn(fcd1);
- fpSpread1.ActiveSheet.RowFilter = sf;
复制代码
?
效果截图:
示例下载:点击下载 |