Here's what I want to do:
In a Datagridview, if the user is editing a cell and has the cursor in, say, position 10, and then moves down or up to an adjacent cell, I want to the new cell to be in edit mode and have the cursor in position 10 with only that position selected (or none selected.) - similar to what you see in any text editor as you move up or down.
However, whenever I move to the next cell, it does go into edit mode, but the whole cell is selected even though I selected just that one position.
private void dgrSource_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
Control ctl = e.Control;
DataGridViewTextBoxEditingControl dText = (DataGridViewTextBoxEditingControl)ctl;
if (lastPos > 0 && lastPos < dText.Text.Length) //lastPos was previously captured and is correct
dText.SelectionStart = lastPos;
dText.SelectionLength = 1;