TrueDBGrid - text column - selection of existing text

Posted by: rick.papke on 20 October 2017, 5:38 am EST

    • Post Options:
    • Link

    Posted 20 October 2017, 5:38 am EST

    In the BeforeColEdit event, I am stuffing the cell with a date stamp when the user clicks into it. I want the cursor to located at the end of this text so the user can type and their content would be appended. The problem is the text in the cell is highlighted so when one types it wipes out the existing content. Is there a way to prevent it from selecting the text?

    I know the user can click once more to put the cursor at the end of the text unselected, but would like to avoid this step if possible.

    TrueDBGrid version 4.0.20172.271

  • Posted 22 October 2017, 7:22 pm EST

    Hello,

    In order to achieve your requirement, I would suggest you to use the following code in MouseDoubleClick event:

    C1TrueDBGrid1.SelectionStart = C1TrueDBGrid1.SelectedText.Length

    C1TrueDBGrid1.SelectionLength = 0

    Hope it helps.

    Thanks,

    Mohit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels