Hi,
When users enter edit mode for a cell in the xamDataGrid, the whole text of that cell is selected. How do I change it to put the caret position to where the mouse is so that users can insert the text where they want to without clicking again?
Thank you.
Hi Bach,
I've attached a sample that I believe should meet your requirement. The sample demonstrates how to set the caret position for the underlying editor in the cell. When a user clicks in the cell, it is placed into edit mode and the caret position is calculated with the TextBox.GetCharacterIndexFromPoint method.
Let me know if you have any questions on this.
Hi Rob,
Thank you for your reply. Your solution works great for XamTextEditor but when I tried with numeric column it seemed to break. the carotPos is always -1:
int carotPos = editorTextBox.GetCharacterIndexFromPoint(pos, false); if (carotPos == -1)
Would you know why?