Index was outside the bounds of the array

6 posts, 0 answers
  1. Roar
    Roar avatar
    1 posts
    Member since:
    Aug 2010

    Posted 31 May 2011 Link to this post

    Hi,
    
    I'm trying to use the RadMaskedNumericInput as follows;
    
    
    <telerik:RadMaskedNumericInput
                    Grid.Row="6"
                    Grid.Column="1"
                    Value="{Binding Mileage}"
                    EmptyContent="kilometer"
                    FormatString="D"
                    Mask="d"
                    IsClearButtonVisible="False"
                    VerticalAlignment="Center"
                    VerticalContentAlignment="Center"
                    />

    ...where the bound 'Mileage'-property is an Int. But when I try to input a number at runtime, I get the following exception;

    "Index was outside the bounds of the array."

    And the stacktrace;

       at System.String.get_Chars(Int32 index)
       at Telerik.Windows.Controls.RadMaskedNumericInput.GetValidCharOverride(Char ch, Int32& position, Nullable`1 forwardSpin, Boolean& isValid) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Input\MaskedInput\RadMaskedNumericInput.cs:line 625
       at Telerik.Windows.Controls.RadMaskedInputBase.ProcessChar(Char ch, Int32& position, Nullable`1 forwardSpin) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Input\MaskedInput\RadMaskedInputBase.cs:line 2693
       at Telerik.Windows.Controls.RadMaskedInputBase.ProcessChar(Char ch, Int32 position, TokenTypes type, Nullable`1 forward, Nullable`1 forwardSpin) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Input\MaskedInput\RadMaskedInputBase.cs:line 2641
       at Telerik.Windows.Controls.RadMaskedInputBase.ProcessKey(Char ch, KeyEventArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Input\MaskedInput\RadMaskedInputBase.cs:line 1548
       at Telerik.Windows.Controls.RadMaskedInputBase.OnKeyDownHandled(Char c) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Input\MaskedInput\RadMaskedInputBase.cs:line 476
       at Telerik.Windows.Controls.MaskedInput.PreviewInputTextBox.OnTextInput(TextCompositionEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Input\MaskedInput\PreviewInputTextBox.cs:line 44
       at System.Windows.UIElement.OnTextInputThunk(Object sender, TextCompositionEventArgs e)
       at System.Windows.Input.TextCompositionEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.TextCompositionManager.UnsafeCompleteComposition(TextComposition composition)
       at System.Windows.Input.TextCompositionManager.PostProcessInput(Object sender, ProcessInputEventArgs e)
       at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.TextCompositionManager.UnsafeStartComposition(TextComposition composition)
       at System.Windows.Input.TextCompositionManager.PostProcessInput(Object sender, ProcessInputEventArgs e)
       at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       at System.Windows.Interop.HwndKeyboardInputProvider.ProcessTextInputAction(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       at System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(MSG& msg, Boolean& handled)
       at System.Windows.Interop.HwndSource.WeakEventPreprocessMessage.OnPreprocessMessage(MSG& msg, Boolean& handled)
       at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.Run()
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
    .... 
  2. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 31 May 2011 Link to this post

    Hi Roar,

    What version are you using to test this. I tested this with the latest ones and I cannot seem to reproduce this exception. Thank you.

    Regards,
    Alex Fidanov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Ivano
    Ivano avatar
    39 posts
    Member since:
    Feb 2009

    Posted 19 Apr 2012 Link to this post

    Hi

    same issue on lastest version when setting Mask='d' or 'n'; even the demo has it.
    I need support for integers or floating points input; I think the way is setting mask to 'D' for integers and 'N' for floating point numbers.

    Sincerely
    Ivano
  5. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 23 Apr 2012 Link to this post

    Hi Ivano,

     I am still not able to reproduce this. However, what you can try is using the '#' token, which is a non-required numeric token.

    All the best,
    Alex Fidanov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Ivano
    Ivano avatar
    39 posts
    Member since:
    Feb 2009

    Posted 02 May 2012 Link to this post

    Hi,
    open your demo (more masket input examples); choose Numeric Input) and put "D" or "N" in the mask field; the issue is related to capital letters. Setting "n" or "d" you don't get any error but input is limited to one digit (?)
    Anyway which mask setting for integers and floating point number?

    Sincerely
    Ivano
  7. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 07 May 2012 Link to this post

    Hello Ivano,

    You can find a list of mask tokens here. I hope it will help, still let us know if you need more info.

    Regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
UI for WPF is Visual Studio 2017 Ready