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
162
Delete key not deleting row when there is an active cell
posted

Hi, i want to be able to delete the active row by pressing de delete key in the keyboard even if there is an active cell in the row (not in edit state). When you select the whole row by clicking on the row selector and then you press the delete key, the active row is deleted. But if you have an active cell and then you press the delete key nothing happens.

I've tried to add KeyActionMapping, but nothing again.

this.ultraGrid1.KeyActionMappings.Add(new GridKeyActionMapping(
                Keys.Delete,
                UltraGridAction.DeleteRows,
                UltraGridState.InEdit,
                UltraGridState.Cell | UltraGridState.Row,
                SpecialKeys.All, 0));

Do I have to handle the delete key in the keypress event?

Is there a keyboard way to deactivate the current cell, and let the row active?

 

Thnx.

Parents
  • 469350
    Offline posted

    I think the reason your new Mapping probably doesn't work is that there are already mappings in the collection that handle the delete key. Since you are adding yours to the bottom of the collection, the existing ones get processed first. Try Inserting your mapping to the top of the collection and see if that works.

    I think that will work, but if not, you might want to try finding the existing mapping that handles the delete key and change it, rather than adding a new one. There are actually quite a few mappings that handle the delete key, but all but one of them has a StateDisallowed of Selected. So you can just search the collection for a mapping whose KeyCode is Delete and whose StateDisallowed is none.

     

Reply Children