Cannot reliably enter edit mode with delete key on WinForms C1FlexGrid

Posted by: aruud on 15 August 2019, 3:39 pm EST

  • Posted 15 August 2019, 3:39 pm EST

    On a new, blank form with a new, blank C1FlexGrid with default options and no event hookups, I cannot enter edit mode with the delete key. This is useful when you have accidentally entered a value and wish to delete it without having to enter edit mode with another key and remove the value.

    I cannot for the life of me figure out why this is happening. I have other instances of C1FlexGrids where the same function is allowed, even after removing all event hookups and copying the options. Obviously something is happening during runtime, but it’s not bound mode vs. unbound mode, whether the column (or its datasource column) allows nulls, or anything to do with intercepting KeyUp/Press/Down. The only commonality I can finds is that the ones that do allow ‘delete-enter’ are bound grids whose columns were not auto-generated.

    I’ve looked over the custom column generation code half-a-dozen times now and nothing important stands out. I know this is very general, but I’m out of ideas myself. Any direction you can point me in would be helpful. I could try to provide a truncated version of the code associated with a ‘functioning’ grid, but it would take time to extract.

    Thanks for reading,

    Alex

    PS. It appears the dropdowns selecting the specifics of the control and environment are broken on the ticket submission page, which is why I am submitting this here. I am running 64-bit Windows 8.1 Pro, developing in VS 2015 (Version 14.025431.01 Update 3). I’m using WinForms C1FlexGrid in the 4.0.20192.375 build. If there’s any other information you need, don’t hesitate to ask.

  • Posted 15 August 2019, 8:24 pm EST

    Of course, I came across a solution after I moved on.

    The option I overlooked multiple times was ‘AutoClipboard = False’ as the default. Setting it to ‘True’ allows users to enter edit mode with the delete key for whatever reason, but it bypasses some of the events normally associated with cell editing. Namely, it does not call ValidateEdit, which I rely on for a custom Undo/Redo implementation. Two steps forward, one step back…

    In any case, will leave the evidence of my silliness up for future Google searches.

  • Posted 16 August 2019, 12:20 am EST

    Hi Alex,

    About the ValidateEdit event not firing when deleting a value using ‘Del’ key: I’ve asked the developers to look into this [Internal Tracking ID: 394250].

    In the meantime, you can also use the CellChanged event for your requirement.

    Regards,

    Jitender

Need extra support?

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

Learn More

Forum Channels