セルに入力された値によって、移動先を変更することはできますか?
対象製品
MultiRow for Windows Forms 10.0J
詳細
NewCellPositionNeededイベント内でNewCellPositionプロパティを使用することで、セルの移動先を変更することができます。
[Visual Basic]
[C#]
[Visual Basic]
Imports GrapeCity.Win.MultiRow Private Sub GcMultiRow1_NewCellPositionNeeded(ByVal sender As Object, ByVal e As GrapeCity.Win.MultiRow.NewCellPositionNeededEventArgs) Handles GcMultiRow1.NewCellPositionNeeded ' 第1セルで"a"が入力された場合、同じ行の第3セルへ移動します If GcMultiRow1.CurrentCellPosition.CellIndex = 0 Then If GcMultiRow1.CurrentCell.EditedFormattedValue = "a" Then e.NewCellPosition = New CellPosition(e.RowIndex, 2) End If End If End Sub
[C#]
using GrapeCity.Win.MultiRow; private void gcMultiRow1_NewCellPositionNeeded(object sender, NewCellPositionNeededEventArgs e) { // 第1セルで"a"が入力された場合、同じ行の第3セルへ移動します if (gcMultiRow1.CurrentCell.CellIndex == 0) { if ((string)gcMultiRow1.CurrentCell.EditedFormattedValue == "a") { e.NewCellPosition = new CellPosition(e.RowIndex, 2); } } }