How to handle editing in DataGridView when SelectionMode = FullRowSelect?

B

bob

I'm using the DataGridView control, with EditMode set to "edit
programatically" and SelectionMode set to "FullRowSelect" (or something
like that). My program allows the User to go into edit mode by
double-clicking a row, or pressing F2, or selecting a menu item
(Row/Edit). When that happens, I turn SelectionMode into "CellSelect"
(or something like that) -- otherwise, the User can't see what he is
editing too well. Ok, now the User edits the data in the current row.
When he's done, he either presses Escape to exit EditMode, or moves to
a new row. If he moves to a new row, I trap that in the "LeaveRow"
event, and turn off EditMode and turn the SelectionMode back to
FullRowSelect.

Problem: When EditMode ends (either by the User pressing Escape, or my
program turning it off programatically) I set SelectionMode back to
FullRowSelect. But the full row isn't fully selected immediately, only
the current cell is. It takes the User moving to another row or two
before the full row is "selected" again, or at least shows that it is
"selected" (by highlighting the entire row).

How can I force the full (new current) row to be hightlighted
immediately, as soon as I turn SelectionMode back to
"FullRowSelect"????

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top