By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,470 Members | 966 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,470 IT Pros & Developers. It's quick & easy.

How to handle editing in DataGridView when SelectionMode = FullRowSelect?

P: n/a
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

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


Jun 20 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.