'How to move the cursor in a DataGridView c#
How to move the cursor in a DataGridView?
No. .Selected = true;
as this puts the cell in blue by default!
I want the cursor to move
When I click on "Add" button, I want the cursor moves to the last row and last column
i use :
this.dGridView.Rows[nbr].Cells[0].Selected = true;
this.dGridView.BeginEdit(true);
but it doesn't work
thanks for help
Solution 1:[1]
I'm not sure this will give you what you want, but you can change the selection background and foreground colors to negate the normal, default appearance of a cell being selected. Get the DataGridViewCell Style property. Then change the Style's SelectionBackColor and SelectionForeColor.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Mike |