I've set SpinWrap=False in a XamNumericEditor but when I hit key up or key down, the value increments or decrements respectively.
How can I disable the increment/decrement function for a XamNumericEditor? I want the XamNumericEditor does not change its value when the user presses key up/down.
Thank you very much
This doesn't work for Dynamically generated xamNumericEditors. Is there any other way to fix the SpinUp and SpinDown to TurnOff.
That does work. Thank you very much.
This is because you and I cannot seem to find the appropriate EventHandler. One way to avoid this is to create a style for the XamNumericEditor like this:
<Style TargetType="{x:Type igEditors:XamNumericEditor}">
<EventSetter Handler="x_ExecutingCommand" Event="ExecutingCommand"/>
</Style>
...
void x_ExecutingCommand(object sender, Infragistics.Windows.Controls.Events.ExecutingCommandEventArgs e)
{
if (e.Command == MaskedEditorCommands.SpinUp || e.Command == MaskedEditorCommands.SpinDown)
e.Cancel = true;
}
Without setting key, it will apply to all of the NumericEditors.
Hope this helps.
Thank you, Alex. Can you put an example?
I'm trying to use this, but VisualStudio does not allow me (Option Strict On):
EventManager.RegisterClassHandler(
NumEditor_ExecutingCommand))
Private
Sub NumEditor_ExecutingCommand(ByVal sender As Object, ByVal e As Infragistics.Windows.Controls.Events.ExecutingCommandEventArgs)
If e.Command.Equals(MaskedEditorCommands.SpinDown) Or e.Command.Equals(MaskedEditorCommands.SpinUp) Then
e.Cancel =
True
End If
End Sub
I've tried to find some sample in the forum but I couldn't.
Oscar,
You can use the EventManager.RegisterClassHandler method to register ExecutingCommand event for all the XamNumericEditors in your application.