【问题标题】:Chang color of RowCell Banded Gridview Devexpress更改行单元格带状网格视图 Devexpress 的颜色
【发布时间】:2014-01-23 04:24:16
【问题描述】:

我按照这篇帖子Create BandedGridView for DevExpress XtraGrid 动态生成乐队,但我需要更改单元格的颜色,但 RowCellStyle 事件不会触发

【问题讨论】:

  • 您是否将事件与事件处理程序绑定?意味着订阅了这些事件?? GridView.RowCellStyle += someHandler
  • 我尝试这样做 DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs RowStyleEventArgs = default(DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs); bandedGridView1_RowCellStyle(bandedGridView1, RowStyleEventArgs);但是当它触发事件时,我在事件中有此代码,但是当我尝试访问 e.ColumnName if (e.Column.Name == "COLUM NAME") { e.Appearance.BackColor = 颜色.深天蓝; e.Appearance.BackColor2 = 颜色.LightCyan; }

标签: c# visual-studio devexpress


【解决方案1】:

实现CustomDrawCell event 并更改那里的颜色。

【讨论】:

  • 感谢您的回答,但我的问题是事件没有触发!唯一触发的事件是 rowstyle
  • 您是否需要“连接”您的活动。类似bandedGridView1.CustomDrawCell += bandedGridView1_CustomDrawCell;
  • 该方法不会触发事件
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-12-13
  • 1970-01-01
  • 2018-10-04
  • 2011-04-27
  • 1970-01-01
相关资源
最近更新 更多