Selecting locked cells when EditModePermanent = true

Posted by: prosegger on 8 September 2017, 1:26 pm EST

  • Posted 8 September 2017, 1:26 pm EST

    I'm looking for a way to have the text in a cell (or, if its CellType is ComboBoxCellType, have the item selected in the combo box) selected on EnterCell.

     Setting fpSpread.EditModePermanent = true provides exactly this functionality, but the problem is that when I have this set I can't trigger the LeaveCell event by clicking on a locked cell.

    My problem would be solved if there were a way to programatically select the contents of the cell, but I can't figure out how to do this. Can someone help me out?




  • Replied 8 September 2017, 1:26 pm EST

    There are a lot of ways you could solve such a problem.

    One, would be to set EditModeReplace to true. That way all text will be selected upon entering a cell.

     Another would be to select the contents of the cell by handling the EditModeOn event and by checking if the EditingControl is of type TextBox and setting its SelectionStart and SelectionLength properties.

     You could also set up event handlers for the EditingControl in the EditModeOn event and when it receives focus set the same above properties.

Need extra support?

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

Learn More

Forum Channels