找回密码
 立即注册

QQ登录

只需一步,快速开始

loacher
论坛元老   /  发表于:2013-3-22 13:35  /   查看:6218  /  回复:2
GcMultiRow.CellContentClick事件里记述了明细上checkbox的值变更后,行的颜色转换处理。
如果快速连续点击鼠标之后,checkbox的值和明细行的颜色变化就混乱了,怎么办才好?
请指教

2 个回复

倒序浏览
dafo
版主   /  发表于:2013-3-26 15:17:00
沙发
如果双击Cell时,CellContentClick只发一次,但是CheckBox状态发生了多次变化,根据你的业务逻辑,建议使用CellEditedFormattedValueChanged去同步业务逻辑。

  1.         void gcMultiRow1_CellEditedFormattedValueChanged(object sender, CellEditedFormattedValueChangedEventArgs e)
  2.         {
  3.             if (e.Scope == GrapeCity.Win.MultiRow.CellScope.Row && this.gcMultiRow1[e.RowIndex, e.CellIndex] is CheckBoxCell)
  4.             {
  5.                 object formatValue = this.gcMultiRow1.GetEditedFormattedValue(e.RowIndex, e.CellIndex);
  6.                 if (formatValue != null && formatValue.ToString().ToLower() == "true")
  7.                 {
  8.                     this.gcMultiRow1.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Red;
  9.                 }
  10.                 else
  11.                 {
  12.                     this.gcMultiRow1.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Blue;
  13.                 }
  14.             }
  15.         }
复制代码
回复 使用道具 举报
loacher
论坛元老   /  发表于:2013-3-26 16:27:00
板凳
thank you
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部