作成日: 2024/01/31 最終更新日: 2024/01/31
文書種別
使用方法
詳細
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);
}
}
}