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
95
Editing Cells Through Key Presses
posted

While the xampivotgrid currently goes into edit mode on a mouse click. I'm interested in setting the cells into edit mode when you hit a number key. During KeyPreviewDown I check if the pressed key was a number key and if the cell is not already in edit mode. If both these are true, I call MoveEditCell and pass in the currently selected/active cell. The problem that I have encountered is that when I open the cell for edit this way, the cell is opened and the inside value is selected. I want to append the numbers they type to the end of the held value, not overwrite it and replace it with the values they type.

Basically, I need to open the cell for edit, deselect the digits, and move the spot where they're typing to the end of the value that is already in there.  How would I go about this? Thanks for any advice.

Parents
  • 138253
    Offline posted

    Hello,

     

    Thank you for your post. I have been looking into it and I can suggest you handle the XamPivotGrid’s CellEnterEdit event and add the following code in its handler:

    Dispatcher.BeginInvoke(new Action(() =>
    {
        System.Windows.Input.KeyEventArgs args = new System.Windows.Input.KeyEventArgs(Keyboard.PrimaryDevice, Keyboard.PrimaryDevice.ActiveSource, 0, Key.Right);
        args.RoutedEvent = Keyboard.KeyDownEvent;
        InputManager.Current.ProcessInput(args); 
    }), System.Windows.Threading.DispatcherPriority.Background, null);

    Please let me know if this helps you or you need further assistance on this matter.

     

    Looking forward for your reply.

Reply Children
No Data