Hi,
I have a field, whose edit type is double, wherein the value in that get incremented or decremented when we have the focus on the field and press up or down arrow in the keyboard. How to disable this feature?
Thanks in advance for your help.
Regards,
Balaji Rajendran
Torrance CA, WK.
You could handle the control's ExecutingCommand and when the e.Command is MaskedEditorCommands.SpinUp or MaskedEditorCommands.SpinDown, set e.Cancel to true.
Sorry to say, the proposed fix is not working. Actually the executingcommand itself is not fired. In my case I have the focus on the cell, which is having EditType as double. While having the focus on the cell and if we press upper arrow or down arrow key the numeric value increments or decrements that got to be avoided, Please suggest. Thanks.
Torrance CA WK.
Hello,
Thank you for your post. I have been looking into it and I have modified Alex’s sample, so now it works as you want. Basically I handled the PreviewKeyDown event of the XamNuemricEditor and cancel edit mode and start edit mode to the next cell, bellow or above the current one.
Hope this helps you.
Hello Balaji,
As Andrew said, the ExecutingCommand is the event that you would have to handle(cancel).
<Style TargetType="{x:Type igEditors:XamNumericEditor}">
<EventSetter Event="ExecutingCommand" Handler="xamNumericEditor1_ExecutingCommand"/>
</Style>
where:
void xamNumericEditor1_ExecutingCommand(object sender, Infragistics.Windows.Controls.Events.ExecutingCommandEventArgs e)
{
if (e.Command == MaskedEditorCommands.SpinDown)
e.Cancel = true;
}
if (e.Command == MaskedEditorCommands.SpinUp)
I am also attaching a sample with this demonstrating cancelling the value increment/decrement of the XamNumericEditor inside a XamDataGrid's cell as well as a stand alone editor.