throw new Error("Unhandled Error in Silverlight Application Object reference not set to an instance of an object.
at Telerik.Windows.Documents.UI.Extensibility.MiniToolBarManager.ShowImageMiniToolBar()\n
at Telerik.Windows.Documents.UI.Extensibility.MiniToolBarManager.RegisterSelectionChanged()\n
at Telerik.Windows.Documents.RichTextBoxCommands.ContextListeners.DocumentContextListener.ContextChangedEventHandler(Object sender, EventArgs e)\n
at System.EventHandler.Invoke(Object sender, EventArgs e)\n
at Telerik.Windows.Documents.Selection.DocumentSelection.OnSelectionChanged()\n
at Telerik.Windows.Documents.Selection.DocumentSelection.AddSelectionEnd(DocumentPosition position, Boolean shouldExpandRanges)\n
at Telerik.Windows.Documents.Selection.MouseSelectionHandler.SelectImage(LayoutBox layoutBoxNode)\n
at Telerik.Windows.Documents.Selection.MouseSelectionHandler.RegisterDocumentSingleMouseDown(Boolean ctrlPressed, Boolean shiftPressed, Point position, UIElement originalSource)\n
at Telerik.Windows.Documents.Selection.MouseSelectionHandler.RegisterDocumentMouseDown(Boolean ctrlPressed, Boolean shiftPressed, Point position, UIElement originalSource)\n
at Telerik.Windows.Documents.UI.DocumentPresenterBase.Owner_MouseLeftButtonDown(Object sender, MouseButtonEventArgs e)\n
at MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)\n
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)");
Call stack window: JScript global code.
Maybe this information would be helpful.
That happens in IE(9 in my case). It seems working OK In Firefox.
Thanks in advance.
Tania
13 Answers, 1 is accepted
Unfortunately we were unable to reproduce the exception. We would appreciate if you could open a support ticket and send us a sample project that demonstrates the issue so that we can further investigate it. Also any additional information about your scenario will be useful too. This includes:
- Do you have any customizations on the ImageMiniToolbar which seems to be in the root of the stack trace.
- Is there anything specific about the document that is currently loaded in the rad rich text box.
- Does this happen with different images.
- Is the issue present in the Q1 2012 release if you tried updating.
Thanks in advance!
Alex
the Telerik team
I've been running some testing on an application (Silverlight 4) I have that I have incorporated a version of your RichTextBox editor from your demos and I'm having a similar problem with images in the RichTextBox. I can left-click to select them but if I then right-click I see the context menu briefly and then it crashes reporting the following unhandled error:
Line: 95
Error: Unhandled Error in Silverlight Application
Code: 2531
Category: ParserError
Message: Failed to assign to property 'System.Windows.Controls.ContentPresenter.Content'.
File:
Line: 514
Position: 76
Also, if I select it with left-click and then select Copy from the ribbon it will not Paste the image into another RichTextBox. Surely it should do this? I'm on the following version: 2012.1.227.1040 and running in IE9.
Hope this helps you to track this down.
I was not able to reproduce either of the problems you have described.
Please find attached the demo I used for testing. If you succeed in achieving the same behavior with the demo, we would appreciate it if you could list the steps. It will also help if you turned on the option to break on every exception and copy the whole stack trace of the exception.
Looking forward to your reply.
Iva Toteva
the Telerik team
Error: Unhandled Error in Silverlight Application Error HRESULT E_FAIL has been returned from a call to a COM component.
The exception object does not have a stack trace.
All I'm doing to get this is run your sample, click in the left RichTextBox and insert an image - I'm using the Windows 7 sample Koala.jpg. I then left click the image to select it and then right mouse click. I see the context menu appear rapidly followed by the error. I cannot seem to get any more of a stack trace than that.
Thank you for the follow up.
We managed to reproduce the problem when only Silverlight 4 is installed on the machine. We have logged the issue, but we may not manage to fix it before the upcoming service pack.
We have updated your Telerik points in appreciation of your involvement.
Iva Toteva
the Telerik team
I think from the previous responses it looks like we at least have a workaround anyway, to move to Silverlight 5 as it appears it will work correctly on that. I know it's something we'll need to do shortly before we complete the project for go live but I've been holding off as long as possible to save any pain at this phase of the development process.
Thanks again.
You are right, if Silverlight 5 is installed on the client machine, the issue with the ContextMenu must not appear. Therefore, if your application targets Silverlight 5, clients will be prompted to install Silverlight 5 and the issue will not appear.
Kind regards,Iva Toteva
the Telerik team
Well, I bit the bullet and upgraded to Silverlight 5 this afternoon and evening and as you and I expected it does now work properly so thanks for your time on that.
I have noticed another issue though which I can't be sure whether it was there before or not. I have the RichTextBox with the full Ribbon (like your Editor example) displayed in a RadWindow. When I click the button for the Styles Gallery nothing appears to happen. To start with I didn't think too much about it and carried on editing the dummy text I was using. However, when I closed the RadWindow the Styles Gallery was then visible so I think it must be getting loaded behind the RichTextBox Window. I've had a look and I don't seem to have control over where and how the Styles Gallery is loaded. Is there some way I can stop this from happening? The alternative would I guess be to move the RichTextBox into a UserControl and to load that into the Visual Tree when I want it but having it in a Window works quite nicely for what I'm trying to do. Sorry for appending this to the other item. I can open a new one if you'd prefer.
Any suggestions?
Thanks and regards
Thank you for pointing out this issue. With the current version of controls, showing a non-dialog window such as ManageStylesDialog over another window works only the first time you open the new window. If the non-dialog window (ManageStylesDialog) loses focus to the bigger window, it will be hidden and it will not be possible to show it again if the bigger window is modal.
We will bring this issue up with the team developing RadWindow to see if they are considering changing this behavior in the future.
Iva Toteva
the Telerik team
i've updated to the Silverlight 4 binaries (Version 2012.1.326.1040) today and since the update each right click on an image results in the following error. Because i think the reason for this error should be the same or at least similar to Paul's, i thought, my posting was in the right place here.
In my case, the error occurs in all browsers (IE 9, Firefox 11, Chrome, ...)
Unhandled Error in Silverlight Application
Code: 2531
Category: ParserError
Message: Fehler beim Zuweisen zu Eigenschaft 'System.Windows.Controls.ContentPresenter.Content'.
File:
Line: 6099
Position: 65
throw new Error(errMsg);
This is only the result in the browser. I can't catch this exception in silverlight so i can't tell you more details, sorry.
The error message is in german. In english this should be someting like:
Failed to assign to property
I used the Q3 2011 binaries (version 2011.3.1220.1040) before (until yesterday) and with this version all is fine. No error, no problems. (With images, some other things such as printing, replacing, ... made the update neccessary, so i can't go back to the old version).
Thank you for contacting us. It seems that the problem occurred only after 2011 Q3 SP1 (2011.3.1220).
We have logged the issue for revision, but it has not been addressed yet.
You can follow our progress on this item using PITS:
You can follow the PITS Issue by its ID: 10614
Public Url: http://www.telerik.com/support/pits.aspx#/public/silverlight/10614
Iva Toteva
the Telerik team
please take a look at another thread in your forums.
http://www.telerik.com/community/forums/silverlight/menu/silverlight-crash-opening-context-menu.aspx
I think, the problem has the same reason. Maybe it helps you to find the bug.
And yes, the problem occurs for each version after 2011.3.1220 for me.
Thank you for your cooperation.
We have contacted the development team responsible for RadContextMenu and at this stage of examination it seems that the problem is caused by the Text Wrapping context menu group which is available on right click over an image. We need to investigate it further to apply an appropriate fix, so you can track the PITS issue we created.
A sample workaround for you can be to create a custom context menu (this help article describes how), which overrides the CreateFloatingBlockCommands method accountable for Text Wrapping context menu group. The override should return NULL to prevent the application from crashing.
Don't hesitate to contact us if you have other questions.
Vasil
the Telerik team