Question about C1.WPF.Automation.4

Posted by: rkane on 21 November 2017, 3:16 pm EST

    • Post Options:
    • Link

    Posted 21 November 2017, 3:16 pm EST

    We have an application with multiple C1 components, mostly FlexGrids. One page loads C1.WPF.Automation.4.dll when the form is moved. After that happens the application will crash with the stack trace below wjen we perform a certain sequence of sorting and filtering. If we remove the C1.WPF.Automation.4.dll the problem goes away.

    1. What would cause C1.WPF.Automation.4.dll to load? We cannot find what is causing this to happen on one page and not others.

    2. How can we debug the error? We must be doing something that the grid does not like but we can’t figure out what it is.

    Version 4.0.20162.524

    SOURCE: mscorlib ThrowArgumentOutOfRangeException

    ERROR: Index was out of range. Must be non-negative and less than the size of the collection.

    Parameter name: index

    MESSAGE:

    System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

    Parameter name: index

    at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)

    at System.Collections.Generic.List`1.get_Item(Int32 index)

    at CallSite.Target(Closure , CallSite , Object , Int32 )

    at C1.WPF.Automation.C1FlexGridRowAutomationPeer…ctor(Object grid, Object panel, Int32 row)

    at CallSite.Target(Closure , CallSite , Type , Object , Object , Int32 )

    at C1.WPF.Automation.C1FlexGridPanelAutomationPeer.#oAg(Int32 #7p, Int32 #8p)

    at C1.WPF.Automation.C1FlexGridPanelAutomationPeer.GetChildrenCore()

    at System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()

    at System.Windows.Automation.Peers.AutomationPeer.UpdateChildrenInternal(Int32 invalidateLimit)

    at System.Windows.Automation.Peers.AutomationPeer.UpdateChildren()

    at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()

    at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()

    at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()

    at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()

    at System.Windows.Automation.Peers.AutomationPeer.UpdatePeer(Object arg)

    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

    at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

  • Posted 21 November 2017, 7:59 pm EST

    Hello,

    Few days back, we received a similar query from Nick (from the same organization). In addition to the error message, he also shared a video, seeing which looks like you are using the C1FlexGrid control with some other control similar to Ribbon. Since we do not have a ready to use control like Ribbon under WPF edition, could you please provide information about that control or if you are creating a User Control, then could you please share the same with us, so that we could test C1FlexGrid with it or you may even modify the uploaded sample containing C1FlexGrid with FilterRow:(https://www.dropbox.com/s/8yjw1gcb7bnslk1/FilterRow.zip?dl=0)

    1. Now, regarding C1.WPF.Automation.4.dll, are you anywhere examining the UI elements using coded UI testing?
    2. Also, this exception in general is thrown when an attempt is made to access an element of an array with an index that is outside its bounds. For debugging the error, you may use Break-Points and check from which line is this error getting raised.

      Also, is there anything that you are doing upon rendering the grid or when the layout updates. If you are using/accessing some collections in there, then we suggest you to use the Count/Length etc to make sure there are enough objects in the collection.

    However, if none of this helps in resolving the issue, then we would need your sample or at least a stripped version of your application to observe the same issue at our end and be able to debug it.

    Thanks,

    Ruchir Agarwal

  • Posted 3 December 2017, 10:47 pm EST

    Same exception here: we apply a filter within the FlexGrid Filter row, the filter is working (rows reduced to the matching), but then we get the above exception afterwards…

    How can we get around that?

    Used versions:

    C1.WPF.4 4.0.20162.524

    C1.WPF.Automation.4 4.0.20162.524

    C1.WPF.FlexGrid.4 4.0.20162.524

    C1.WPF.FlexGrid.GroupPanel.4 4.0.20162.524

    C1.WPF.FlexGridFilter.4 4.0.20162.524

    C1.WPF.Toolbar.4 4.0.20162.524

  • Posted 4 December 2017, 11:20 pm EST

    Hi,

    Are you able to replicate the issue with product sample FIlterRow at “…\Documents\ComponentOne Samples\WPF\C1.WPF.FlexGrid\CS\FilterRow”. We could not observe the issue running it, referencing the same dlls as yours.

    If the issue does not occur, then we will need your application or a stripped version of your application reproducing the issue, so that we could observe the same behavior at our end and investigate on it.

    Also, you may try testing the issue using the latest build, that can be downloaded from: http://prerelease.componentone.com/dotnet40/c1wpflibrary/2017-t3/C1WPFBasicLibrary.4_4.0.20173.578.zip

    Thanks,

    Ruchir Agarwal

  • Posted 5 December 2017, 3:18 am EST

    The following might be of relevance:

    • "

    • “Code runs on Windows 8.1”

    • “The filter is created/set in code behind”

    "

  • Posted 5 December 2017, 9:53 pm EST

    I prepared a stripped sample from your FlexGridSamples zip provided.

    FlexGridSamples.zip

    Changes: have a look at Filtering\Filtering.xaml and Filtering\Filtering.xaml.cs, I simply added classes (CellFactory, etc.) within the code behind file.

    Two additional image files (funnel_*.png) within the Filtering subfolder.

    Added C1.WPF.Automation.4.dll to the bin\Debug and bin\Release folder.

    To reproduce the issue: it is important you have the C1.WPF.Automation.4.dll within the project target folder! If it is not there, the issue went away, if it is there, the ArgumentOutOfRangeException is caused (search within the .xaml.cs for the catch {} (did not work, cannot be catched there, only within Application.Unhandled_Exceptions handler…

    And: as I yet mentioned I am still on Windows 8.1, if that matter.

    Regards, Torsten

  • Posted 6 December 2017, 1:26 am EST

    Hi Torsten,

    Thank you for sharing the modified application.

    I tried running the sample with my win10 machine, but the issue did not occur. So, we believe that it might be an OS specific issue, so I am now going to test the issue with your sample on a Win8.1 machine. I will keep you updated with the progress on this case.

    Thanks,

    Ruchir Agarwal

  • Posted 6 December 2017, 7:44 pm EST

    Hi Torsten,

    We tested the application with Win8.1 too but the issue did not reproduce at our end, even if C1.WPF.Automation.4.dll was within the project. Please refer attached video file showing the application behavior at our end.

    Could you please share a small video showing the issue at your end, so that we may report the same to the concerned team for investigation.

    Thanks,

    Ruchir Agarwal

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels