Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
520
Caret Position when entering edit mode
posted

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. 

Parents
  • 34510
    Offline posted

    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.

    xamDataGrid-SetCaretPosition.zip
Reply Children