- Private Sub GcMultiRow1_CellEditedFormattedValueChanged(sender As Object, e As GrapeCity.Win.MultiRow.CellEditedFormattedValueChangedEventArgs) Handles GcMultiRow1.CellEditedFormattedValueChanged
- If e.CellName = "comboCell" Then
- ChangeValue(True, Me.GcMultiRow1.CurrentCell.EditedFormattedValue, e.RowIndex)
- End If
- If e.CellName = "textCell" Then
- ChangeValue(False, Me.GcMultiRow1.CurrentCell.EditedFormattedValue, e.RowIndex)
- End If
- End Sub
- Private Sub GcMultiRow1_CellValueChanged(sender As Object, e As GrapeCity.Win.MultiRow.CellEventArgs) Handles GcMultiRow1.CellValueChanged
- If e.CellName = "comboCell" Then
- ChangeValue(True, Me.GcMultiRow1.CurrentCell.EditedFormattedValue, e.RowIndex)
- End If
- If e.CellName = "textCell" Then
- ChangeValue(False, Me.GcMultiRow1.CurrentCell.EditedFormattedValue, e.RowIndex)
- End If
- End Sub
- Private Sub ChangeValue(fromCombo As Boolean, value As Object, rowIndex As Integer)
- If fromCombo Then
- '根据value的值从数据表中对应的行。然后取出对应的TextCell应该的值,最后用GcMultiRow.SetValue(rowIndex, "textCell", newValue)方法改变TextCell的值。
- End If
- If Not fromCombo Then
- '根据value的值从数据表中对应的行。然后取出对应的ComboCell应该的值,最后用GcMultiRow.SetValue(rowIndex, "comboCell", newValue)方法改变ComboCell的值。
- End If
- End Sub
复制代码 |