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

The given key was not present in the dictionary. Exception Rich Text Box

3 Answers 620 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 18 Jul 2011, 03:22 PM
Hello,

I am using the rad rich text box to try to upload documents, and I'm getting this exception

The given key was not present in the dictionary.

Stack Trace:

at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Telerik.Windows.Documents.FormatProviders.OpenXml.OpenXmlHelper.ConvertStringToUnderline(String value)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.SpanStyleImporter.ReadUnderline(Style style)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.SpanStyleImporter.ReadStyle(Style style)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.ParagraphStyleImporter.ReadStyle(Style style)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.ParagraphImporter.Import(Style parentStyle)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.TableImporter.ImportTableCell(Style parentStyle)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.TableImporter.ImportTableRow(Style parentStyle)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.TableImporter.Import(Style parentStyle)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.MainDocumentImporter.BuildTable(Style parentStyle)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.MainDocumentImporter.BuildBody()
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.MainDocumentImporter.BuildDocument()
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.MainDocumentImporter.Import()
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.ReadXmlContentFromPackage(DocxPartImporterBase importer)
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.Import.DocxImporter.Import()
at Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.DocxFormatProvider.Import(Stream input)
at Telerik.Windows.Documents.FormatProviders.DocumentFormatProviderBase.Import(Byte[] input)
at DocumentEditor.MainPage.service_GetUploadedDocumentForItemIDCompleted(Object sender, GetUploadedDocumentForItemIDCompletedEventArgs e)
at DocumentEditor.WSPEditorService.WSPEditorServiceClient.OnGetUploadedDocumentForItemIDCompleted(Object state)

I can get you the docx file that I'm using if you'd like, but I am not able to attach it to this post because the uploader only supports images.

3 Answers, 1 is accepted

Sort by
0
Ivailo Karamanolev
Telerik team
answered on 21 Jul 2011, 10:44 AM
Hello Aaron,

Thank you for reporting this issue. The problem occurs when the document has an underline type that is not supported by RadDocument. However, an unhandled exception is not a normal behavior, so we've fixed that. The change will be visible in the next official release at the latest (Q2 SP1).

All the best,
Ivailo
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Aaron
Top achievements
Rank 1
answered on 22 Aug 2011, 10:28 PM
Hang on, I realize you answered this a long time ago, but I didn't read what you said close enough.  Are you saying this is going to be fixed or that you're just going to catch the exception?
0
Ivailo Karamanolev
Telerik team
answered on 26 Aug 2011, 09:47 AM
Hi Aaron,

When there is an underline type that we do not support, it is normal not be rendered correctly. However, no unhandled exceptions should occur. If you update to a later version than the one I mentioned, preferably the last one, 2011 Q2, no issues should be present with these documents. However, if you happen to encounter any documents that you can not import, feel free to open a support ticket of type General Feedback and attach the document for us to review.

Greetings,
Ivailo
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
RichTextBox
Asked by
Aaron
Top achievements
Rank 1
Answers by
Ivailo Karamanolev
Telerik team
Aaron
Top achievements
Rank 1
Share this question
or