There are two subtle reasons why the timer is required.
MouseDown event occurs before SelectionChanged event.
At the end of SelectionChanged event the focus returns to the table.
So if we want to move the focus to the textbox we need to use the timer.
The second reason happens when you click on a partially hidden cell.
The table automatically scrolls the horizontal and/or vertical scrollbar in such way that the cell will be fully visible.
This rearrangement occurs after MouseMove event.
We must make the position calculations only after this rearrangement so again the timer is necessary.
|