■9148 / ) |
Re[1]: DataGridViewのセルをEnterキーで横移動したい |
□投稿者/ あきひろ 一等兵(20回)-(2006/12/13(Wed) 20:14:38)
|
分類:[C#]
何がしたいのかよく見えてないので外しているかもしれませんが、 overrideしたOnPreviewKeyDown中の、ColumnIndexをインクリメントする 直前で、その行が最下行かどうかの判断をするのじゃだめでしょうか?
grid.CurrentCell = grid[grid.CurrentCell.ColumnIndex + 1, grid.CurrentCell.RowIndex]; return;
となってるところを、 if (grid.CurrentCell.RowIndex != grid.RowCount - 1) { grid.CurrentCell = grid[grid.CurrentCell.ColumnIndex + 1,grid.CurrentCell.RowIndex]; return; } みたいな。
|
0
|