ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.

https://github.com/unvell/ReoGrid/issues

#1 2016-05-26 10:26:07

brian.shankland
Member
Registered: 2016-05-11
Posts: 15

BeforeCellKeyDown

Am I correct in thinking this should fire for each key that the user strikes when entering a new value into a cell, and that if I set e.isCancelled=true then that keystroke will ignored but editing can continue?

I want to use this to reject keystrokes that are not valid in thecurrent editing context i.e. if I know the value should be numeric it should only accept keys for numbers, decimal point and backspace.

I can see if fires when I click on a cell and type the first key, but all subsequent key presses do not fire the event, so in the above case if the first keystroke if "T" it is ignores but if I type "1T" this is accepted.

Also if I double click the cell so it goes into its edit mode directly, it will not fire the event even for the first key press either.

I'm using V1.2.3 in WPF. I also have the BeforeCellEdit and AfterCellEdit events set if this could be adding to the problem, although they are working correctly.

Offline

#2 2016-05-28 14:58:49

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: BeforeCellKeyDown

When cell goes edit mode you can use CellEditCharInputed event. Set the InputChar to 0 can disable input.

In addition, we currently working on a new feature of cell input, which can be set to accept number only, currently the feature is planned available in Pro edition.

Offline

#3 2016-06-04 00:40:42

drdbkarron
Member
Registered: 2015-05-06
Posts: 29

Re: BeforeCellKeyDown

I think there is a bad interaction between before and after value changes.

It recurses and seems to hop around when I want to make the arrow keys steer a 2x2 range selection as a focus cell range.
Jing, We really need to do an IFormat hook so we can make exotic criteria for data format. I want users to enter a 2x2 matrix kernel to move around, up and down (in a stack).

Offline

#4 2016-12-26 07:28:22

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: BeforeCellKeyDown

Offline

Board footer

Powered by FluxBB