I think the main requirement is that
1) Cell End Edit (by pressing tab key to move focus in the next cell)
2) If Next Cell is Ready Only then find the Next Cell which is NOT
Read Only
3) If Cell Found then put focus in that Cell
If we don't use the CellEndEdit then "whenever the selection is
changed" to the read-only cell, the focus will be forwarded to NON-
readonly cell. Which I think is NOT a good user experience. Since user
will be trying to put the cursor in the read-only cell (to copy maybe)
but he/she will never be able to do this. Therefore the logic can be,
1) In CellEndEdit Event Handler
*) mark some flag (a boolean variable) that CellEndEdit
event occurred
2) In CellEnter or CurrentCellChanged event handler
*) check that if this event is occured after the
CellEndEdit andalso mouse was NOT used to End the editing
*) if above checking is true then
- clear the flag (that indicates the CellEndEdit
event)
- get number of times to send the tab key
- send tab keys 'n' times
I have used the same Send Keys because exception is thrown if we try
to use the CurrentCell property.
Regards,
Arsalan Tamiz
On Jan 30, 3:49 am, rbdavidson <[email protected]> wrote:
> I figured out a solution, but it is convoluted enough that I'm not
> going to post it here. For those who are interested, here is a link
> to a post on a MSDN forum that put me on the right
> track.http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/th...
>
> - R.B.Davidson