如果双击Cell时,CellContentClick只发一次,但是CheckBox状态发生了多次变化,根据你的业务逻辑,建议使用CellEditedFormattedValueChanged去同步业务逻辑。
- void gcMultiRow1_CellEditedFormattedValueChanged(object sender, CellEditedFormattedValueChangedEventArgs e)
- {
- if (e.Scope == GrapeCity.Win.MultiRow.CellScope.Row && this.gcMultiRow1[e.RowIndex, e.CellIndex] is CheckBoxCell)
- {
- object formatValue = this.gcMultiRow1.GetEditedFormattedValue(e.RowIndex, e.CellIndex);
- if (formatValue != null && formatValue.ToString().ToLower() == "true")
- {
- this.gcMultiRow1.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Red;
- }
- else
- {
- this.gcMultiRow1.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Blue;
- }
- }
- }
复制代码 |