找回密码
 立即注册

QQ登录

只需一步,快速开始

FBAccount

中级会员

21

主题

73

帖子

701

积分

中级会员

积分
701

活字格认证

FBAccount
中级会员   /  发表于:2017-3-16 17:41  /   查看:2992  /  回复:3
本帖最后由 FBAccount 于 2017-3-16 17:44 编辑

请问如何更改 C1.Win.C1FlexGrid 字段排序(三角形)的颜色以及筛选提示符号的颜色

如附图中红框的部分

谢谢!!


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

3 个回复

倒序浏览
Alice
社区贡献组   /  发表于:2017-3-17 14:38:27
沙发
不好意思回复晚了
我理解您是需要更改sort和filter的图标。

这里您需要重绘ColumnHeader单元格,重新给一个您认为合适的图表。
重绘需要使用OwnerDrawCell事件。
代码参考:
  1. void _flex_OwnerDrawCell(object sender, OwnerDrawCellEventArgs e)
  2. {
  3. // paint sort glyphs on the last fixed column
  4. if (e.Row == _flex.Rows.Fixed - 1 &&
  5. _flex.Cols[e.Col] == _flex.SortColumn)
  6. {
  7. // select glyph based on setting of the Sort property
  8. switch (_flex.Cols[e.Col].Sort)
  9. {
  10. case C1.Win.C1FlexGrid.SortFlags.Ascending:
  11. e.Image = Properties.Resources.Ascending;
  12. break;
  13. case C1.Win.C1FlexGrid.SortFlags.Descending:
  14. e.Image = Properties.Resources.Descending;
  15. break;
  16. }
  17. }
  18. }
复制代码

评分

参与人数 1满意度 +5 收起 理由
FBAccount + 5 很给力!

查看全部评分

请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
FBAccount
中级会员   /  发表于:2017-3-20 15:07:37
板凳
sort的图示已经可更改
但是filter的图示该怎么更改

谢谢!!

回复 使用道具 举报
Alice
社区贡献组   /  发表于:2017-3-20 17:02:19
地板
FBAccount 发表于 2017-3-20 15:07
sort的图示已经可更改
但是filter的图示该怎么更改

设置一个backgroudImage,然后放到右侧的位置。
代码参考
  1.    CellStyle cs=this.c1FlexGrid1.Styles.Add("FilterStyle");
  2.             cs.BackgroundImage = this.c1FlexGrid1.Glyphs[C1.Win.C1FlexGrid.GlyphEnum.FilterEditor];
  3.             cs.BackgroundImageLayout = ImageAlignEnum.RightCenter;
  4.             c1FlexGrid1.SetCellStyle(0, 1, cs);
  5.             c1FlexGrid1.ShowButtons = ShowButtonsEnum.Always;
复制代码

评分

参与人数 1满意度 +5 收起 理由
FBAccount + 5 很给力!

查看全部评分

请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部