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
135
User defined KeyActionMapping event
posted

I currently have an UltraGrid control, which has multiple bands. When I'm on a band[0] line I want to be able to add keyboard shortcuts (such as ALT+C or ALT+P) to add a new row to one of the child bands. I've figured out the code to add the row to the desired child band, expand to the new row and activate edit mode on it; however I still can't find a satisfactory way to do this from the keyboard.

During my investigations I found the ability to add a GridKeyActionMapping, however the things that are performed seem to be limited to the list of events, so my query is - can I somehow override this to fire a method of my own?

Or, is there a better/different way of doing what I'm trying to achieve?

Many thanks in advance for your help.

Parents
  • 2165
    posted

    Hello Martin,

    In order to add a new row to a specific child band using a keyboard combination you could use the KeyDown event of the UltraGrid. When you press the desired combination this event is fired and according to the combination a method which adds the new row to a specific child band is called. Using a switch statement in the body of the KeyDown event gives you the opportunity to clasp other combinations that perform other methods.

    I’ve implemented this suggestion in a simple sample, and you could run and evaluate it, please see attached zip.

    Please let me know if you have any further questions.

    KeyActionMapping.zip
Reply Children