This is a migrated thread and some comments may be shown as answers.

Error on ContextMenu: value does not fall within the expected range

12 Answers 106 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michael Maddux
Top achievements
Rank 1
Michael Maddux asked on 28 Jul 2010, 04:32 PM
Hello,

We are seeing this error only on some user's workstations.  We don't know what is different about these workstations - perhaps different Silverlight or IE settings?

The error occurs during the following call (ContextMenu is an object of type RadContextMenu)....

ContextMenu.GetClickedElement<

 

GridViewCell>()

 


The error message is "value does not fall within the expected range"

Here is the stack trace...

   at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
   at MS.Internal.XcpImports.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData)
   at MS.Internal.XcpImports.UIElement_TransformToVisual(UIElement element, UIElement visual)
   at System.Windows.UIElement.TransformToVisual(UIElement visual)
   at Telerik.Windows.Controls.ApplicationHelper.TransformToScreenRoot(UIElement target)
   at Telerik.Windows.Controls.VisualTreeHelperExtensions.GetElementsInHostCoordinates[T](UIElement subtree, Point position)
   at Telerik.Windows.Controls.VisualTreeHelperExtensions.GetElementsInScreenCoordinates[T](Point mousePosition, FrameworkElement rootVisual)
   at Telerik.Windows.Controls.VisualTreeHelperExtensions.GetElementsInScreenCoordinates[T](FrameworkElement relativeTo, Point mousePosition)
   at Telerik.Windows.Controls.RadContextMenu.GetClickedElement[T]()
   at Pmc.Controls.PmcGridView.ContextMenu_Opened(Object sender, RoutedEventArgs e)
   at Telerik.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RadRoutedEventArgs routedEventArgs)
   at Telerik.Windows.RouteItem.InvokeHandler(RadRoutedEventArgs routedEventArgs)
   at Telerik.Windows.EventRoute.InvokeHandlersImpl(Object source, RadRoutedEventArgs args, Boolean raisedAgain)
   at Telerik.Windows.EventRoute.InvokeHandlers(Object source, RadRoutedEventArgs args)
   at Telerik.Windows.RadRoutedEventHelper.RaiseEvent(DependencyObject element, RadRoutedEventArgs args)
   at Telerik.Windows.DependencyObjectExtensions.RaiseEvent(DependencyObject element, RadRoutedEventArgs e)
   at Telerik.Windows.Controls.RadContextMenu.OnOpened(RadRoutedEventArgs e)
   at Telerik.Windows.Controls.RadContextMenu.OnPopupOpened(Object source, EventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)


Thanks for your attention!

Mike Maddux


12 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 29 Jul 2010, 01:38 PM
Hi Michael Maddux,

Could you please share what is the exact version of the controls that you use? This problem appeared in older version of RadControls and it should works as expected in our latest release.You can also find attached project that works as expected with the latest version.


All the best,
Rosi
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
0
Morgan McCollough
Top achievements
Rank 1
answered on 18 Aug 2010, 04:07 PM
I work with Mike, and we are seeing this exact same error again with the 8/12 build of the 2010 Q2 release (2010.2.812.1040). Could this bug have crept back in again? Thanks!
0
Hristo
Telerik team
answered on 19 Aug 2010, 03:30 PM
Hi Morgan McCollough,

We had such issue with one of  the Latest Internal Builds but we fix it for the official 2010.Q2.SP1.
Could you send us sample project that we can investigate?

Regards,
Hristo
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
0
Morgan McCollough
Top achievements
Rank 1
answered on 24 Aug 2010, 11:17 PM
I added our context menu to a grid in one of your example projects in order to try and recreate this. I have not had luck yet, but I'll keep experimenting. I'm guessing it has something to do with the specific way we are using the grid. I'll try and make the sample as much like our actual app as possible as I have the time and post the project when I can reproduce it.

The problem is actually intermittent on our production deploy. I was only able to reproduce it once or twice in my dev environment locally, so it has been hard to track down the exact conditions that cause it.
0
Hristo
Telerik team
answered on 26 Aug 2010, 10:02 AM
Hi Morgan McCollough,

Let us know when the repro project is ready.

Sincerely yours,
Hristo
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
0
Morgan McCollough
Top achievements
Rank 1
answered on 31 Aug 2010, 10:36 PM
I think I finally have a version that reproduces the issue. It is a little unclear whether it is EXACTLY the same sequence of events that causes it on our production system. Anyway, it seems to have something to do with the presence of a row expansion panel. How can I send you the project?
0
Hristo
Telerik team
answered on 01 Sep 2010, 07:53 AM
Hello Morgan McCollough,

You have to open a support ticket in order to attach files.

Greetings,
Hristo
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
0
Prithvi
Top achievements
Rank 1
answered on 17 Nov 2011, 10:28 AM
We are also facing the same problem, not every time, but by following one particular process my silverlight application crashed.
We are using an RadHtmlPlaceholder in one page. After making some changes in page if we are navigate to another page or main page without save changes which we have done, our application crashed with below error message.

Error :

[Window Title]
Visual Studio Just-In-Time Debugger

[Main Instruction]
An unhandled exception ('Unhandled Error in Silverlight Application
Code: 4004    
Category: ManagedRuntimeError       
Message: System.ArgumentException: Value does not fall within the expected range.
   at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
   at MS.Internal.XcpImports.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData)
   at MS.Internal.XcpImports.UIElement_TransformToVisual(UIElement element, UIElement visual)
   at System.Windows.UIElement.TransformToVisual(UIElement visual)
   at Telerik.Windows.Controls.ApplicationHelper.TransformToScreenRoot(UIElement target)
   at Telerik.Windows.Controls.RadHtmlPlaceholder.OnLayoutUpdated()
   at Telerik.Windows.Controls.RadHtmlPlaceholder.<Init>b__14()     
') occurred in iexplore.exe [2252].

The Just-In-Time debugger was launched without necessary security permissions. To debug this process, the Just-In-Time debugger must be run as an Administrator. Would you like to debug this process?

[V] View process details  [Yes, debug iexplore.exe] [No, cancel debugging]

[Expanded Information]
Process Name: C:\Program Files (x86)\Internet Explorer\iexplore.exe

Do you have any idea why it happen? Because we are using RadHtmlPlaceholder in detail page and this error produce when we are navigating from detail page.....
0
Konstantina
Telerik team
answered on 22 Nov 2011, 09:00 AM
Hello Prithvi,

Which version of the controls you are using? Could you please try with the latest official version - Q3 2011 and let us know if that fixes the issue.

Best wishes,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Prithvi
Top achievements
Rank 1
answered on 22 Nov 2011, 12:44 PM
Hello Konstantina,

Thanks for you quick reply.

After posting our problem on Nov 17, 2011, we download latest build : RadControls_for_Silverlight4_2011_3_1116_Dev.msi and installed it. And our problem was solved, and application was running properly.

But today we found same problem in other page for child window case. We are using child window for showing some detail using RadHtmlPlaceHolder control, when we close that child window we got same error again.

So can you guide me that now what we should do in case of child window?
0
Alan
Top achievements
Rank 1
answered on 22 Nov 2011, 08:00 PM
Old thread I know, but we find that this happens reliably under the following conditions:
1.  Load some rows into the RadGrid and on the OnLoad event set the context menu programmatically via RadContextMenu.SetContextMenu().
2. Set a filter on a column such that there aren't enough rows to fill up the entire grid.  That is, scroll bars should not appear.  This is the key step.  There must be an active column filter with some items filtered out and the rows must not span the entire height of the grid.
3. Then right click on a row that has had a context menu set.
0
Petar Mladenov
Telerik team
answered on 23 Nov 2011, 05:27 PM
Hello Prithvi,

We highly suggest you to use RadWindow instead of ChildWindow as a container for the RadHtmlPlaceholder.
There are some known rendering issues when using ChildWindow which make it useless in such sceanarios.

Greetings,
Petar Mladenov
the Telerik team

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

Tags
GridView
Asked by
Michael Maddux
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Morgan McCollough
Top achievements
Rank 1
Hristo
Telerik team
Prithvi
Top achievements
Rank 1
Konstantina
Telerik team
Alan
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or