找回密码
 立即注册

QQ登录

只需一步,快速开始

xgsoftware

注册会员

12

主题

29

帖子

198

积分

注册会员

积分
198

活字格认证

[已处理] Spread Asp.net 过滤

xgsoftware
注册会员   /  发表于:2015-11-2 16:28  /   查看:4369  /  回复:4
使用Spead Asp.net 6.0添加过滤,列头显示了过滤下拉列表,但是选择其中一项不会进行过滤,感觉应该是有什么js没执行,是需要怎么设置吗
代码:
            FarPoint.Web.Spread.IRowFilter rowFilter = new FarPoint.Web.Spread.HideRowFilter(sheet);

            // add a FilterColumnDefinition for Columns
            int iColumnIndex = this.GetStatusColumnIndex();

            FarPoint.Web.Spread.NamedStyle instyle = new FarPoint.Web.Spread.NamedStyle();
            FarPoint.Web.Spread.NamedStyle outstyle = new FarPoint.Web.Spread.NamedStyle();
            instyle.BackColor = Color.Yellow;
            outstyle.BackColor = Color.Gray;
            FarPoint.Web.Spread.StyleRowFilter rf = new FarPoint.Web.Spread.StyleRowFilter(sheet, instyle, outstyle);
            sheet.RowFilter = rf;
            // Assign filter and customize filter options.
            sheet.RowFilter.AddColumn(iColumnIndex);
            sheet.RowFilter.ShowFilterIndicator = true;
            sheet.RowFilter.AllString = "全部";
            sheet.RowFilter.NonBlanksString = "非空";
            sheet.RowFilter.UnfilteredRows = new int[1] { 0 }
QQ截图20151102162729.png

4 个回复

倒序浏览
Alice
社区贡献组   /  发表于:2015-11-2 17:53:00
沙发
回复 1楼xgsoftware的帖子

非常感谢您的反馈。
您的代码我们收到了,测试后给您反馈。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
Helen
高级会员   /  发表于:2015-11-3 14:09:00
板凳
回复 1楼xgsoftware的帖子

“但是选择其中一项不会进行过滤”,请问您的意思是指第一行不进行过滤还是选择下拉过滤Item都不起作用呢?
如果是第一行不起作用,那是因为您设置了:
sheet.RowFilter.UnfilteredRows = new int[1] { 0 };
如果是都不起作用,我这边无法重现。您可以看到下图我的测试程序是可以画出过滤不同颜色的。

sap.png
另外附上我的测试程序供您参考。
WebApplication10.zip (15.12 KB, 下载次数: 152)
回复 使用道具 举报
xgsoftware
注册会员   /  发表于:2015-11-4 11:08:00
地板
好的   感谢  我试试您的代码
回复 使用道具 举报
Helen
高级会员   /  发表于:2015-11-4 12:02:00
5#
回复 4楼xgsoftware的帖子

好的,如果您的问题解决了,欢迎您给我们评分,帮助我们改进服务。谢谢!

Satisfy_5_1.gif

评分

参与人数 1满意度 +5 收起 理由
xgsoftware + 5 谢谢 问题解决

查看全部评分

回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部