This question is locked. New answers and comments are not allowed.
Hi,
We are using numeric up downs in a grid, but we do not want the up and down keys to change the value as we would like to preserve them for navigating around the grid. Previously, we were able to do this by overriding the OnKeyDown event. Since updating to 2014.1.224 from 2013.2.0611, this no longer works. I've compared the two binaries with reflector and it looks like the signature of the OnKeyDown event has changed from OnKeyDown(KeyEventsArgs e) to OnKeyDown(object sender, KeyEventsArgs e). We are unable to override this new event, and therefore the base one is always firing.
Can you provide a workaround please?
Thanks,
Andrea
We are using numeric up downs in a grid, but we do not want the up and down keys to change the value as we would like to preserve them for navigating around the grid. Previously, we were able to do this by overriding the OnKeyDown event. Since updating to 2014.1.224 from 2013.2.0611, this no longer works. I've compared the two binaries with reflector and it looks like the signature of the OnKeyDown event has changed from OnKeyDown(KeyEventsArgs e) to OnKeyDown(object sender, KeyEventsArgs e). We are unable to override this new event, and therefore the base one is always firing.
Can you provide a workaround please?
Thanks,
Andrea
7 Answers, 1 is accepted
0
Hello Andrea,
The change is the following - we are no longer overriding the OnKeyDown of the TextBox inside the NumericUpDown, but hooking to the event. So, I would suggest you to do the same.
Please give it a try and let us know if this is working for you.
Regards,
Konstantina
Telerik
The change is the following - we are no longer overriding the OnKeyDown of the TextBox inside the NumericUpDown, but hooking to the event. So, I would suggest you to do the same.
Please give it a try and let us know if this is working for you.
Regards,
Konstantina
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
0
Andrea
Top achievements
Rank 1
answered on 01 May 2014, 08:36 AM
Hi Konstantina,
Thanks for getting back to me. However, that didn't work. It looks like the RadNumericUpDown class attaches to the evfent handler like this:
base.AddHandler(UIElement.KeyDownEvent, new KeyEventHandler(this.OnKeyDown), true);
The last argument to AddHandler is described as follows:
handledEventsToo
Type: System.Boolean
true to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled.
The default is false.
Do not routinely ask to rehandle a routed event. For more information, see Remarks
Even if I set Handled = true in my event handler, it won't stop your handler from running.
Any ideas?
Thanks,
Andrea
Thanks for getting back to me. However, that didn't work. It looks like the RadNumericUpDown class attaches to the evfent handler like this:
base.AddHandler(UIElement.KeyDownEvent, new KeyEventHandler(this.OnKeyDown), true);
The last argument to AddHandler is described as follows:
handledEventsToo
Type: System.Boolean
true to register the handler such that it is invoked even when the routed event is marked handled in its event data; false to register the handler with the default condition that it will not be invoked if the routed event is already marked handled.
The default is false.
Do not routinely ask to rehandle a routed event. For more information, see Remarks
Even if I set Handled = true in my event handler, it won't stop your handler from running.
Any ideas?
Thanks,
Andrea
0
Hi Andrea,
We understand your concern. However we will need additional time to research for a proper solution. We will get back to you as soon as possible.
Thanks for the understanding.
Regards,
Kalin
Telerik
We understand your concern. However we will need additional time to research for a proper solution. We will get back to you as soon as possible.
Thanks for the understanding.
Regards,
Kalin
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
0
Andrea
Top achievements
Rank 1
answered on 06 May 2014, 07:52 AM
Hi Kalin,
Thanks for getting back to me. Are you able to advise of any timescales? Does it help if I log this as a support ticket?
Thanks,
Andrea
Thanks for getting back to me. Are you able to advise of any timescales? Does it help if I log this as a support ticket?
Thanks,
Andrea
0
Hello Andrea,
Thank you for your patience.
We have thoroughly researched the possibility of changing this behavior, but that will break the already fixed bug. However, I am sending you a sample application in which I have proposed a work-around to achieve the desired behavior.
Hope it helps.
Regards,
Konstantina
Telerik
Thank you for your patience.
We have thoroughly researched the possibility of changing this behavior, but that will break the already fixed bug. However, I am sending you a sample application in which I have proposed a work-around to achieve the desired behavior.
Hope it helps.
Regards,
Konstantina
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
0
Andrea
Top achievements
Rank 1
answered on 13 May 2014, 08:05 AM
Hi Kalin,
Thanks! However, I haven't received the sample application? Were you going to attach it to your post or am I just being blind and not seeing it?
Thanks,
Andrea
Thanks! However, I haven't received the sample application? Were you going to attach it to your post or am I just being blind and not seeing it?
Thanks,
Andrea
0
Hi Andrea,
Sorry, there was a problem with the post.
I have attached it to the previous post. Please download it and give it a try.
Regards,
Konstantina
Telerik
Sorry, there was a problem with the post.
I have attached it to the previous post. Please download it and give it a try.
Regards,
Konstantina
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.