We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Load() for empty Text hangs

Thread ID:

Created:

Updated:

Platform:

Replies:

127852 Dec 13,2016 04:00 PM Dec 16,2016 12:55 AM WPF 5
loading
Tags: SfRichTextBoxAdv
Bernd
Asked On December 13, 2016 04:00 PM

Hi,

I am encountering a strange problem with SfRichTextBoxAdv: I do update the RichTextBox Content according to the MVVM sample with LoadStream().

I do reuse the control an a WPF page and load the contents like this:

            using (Stream stream = new MemoryStream())
            {
                byte[] bytes = Encoding.UTF8.GetBytes(text); // Convert the text string to byte array.

                stream.Write(bytes, 0, bytes.Length); // Writes the byte array to stream.
                stream.Position = 0;

                Load(stream, format); // Load the stream
            }

Sometimes on a successive Load() with an empty (!) string the application hangs and times out with the following error:

Assistent für verwaltetes Debuggen "ContextSwitchDeadlock"  ist aufgetreten.
  HResult=0x00000000
  Nachricht = **Assistent für verwaltetes Debuggen "ContextSwitchDeadlock" :** "The CLR has been unable to transition from COM context 0xbf268170 to COM context 0xbf268048 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations."

Any ideas what causes this issue?

And is there anothe way to completely clear the SfRichTextBoxAdv Contents other thal Loading an empty Document? There is no Clear() function.

Regards
Bernd




Venkatesan Mani [Syncfusion]
Replied On December 14, 2016 12:45 AM

Hi Bernd,

Thank you for contacting Syncfusion support.

You can clear the contents of SfRichTextBoxAdv control by executing “NewDocumentCommand”. Please find the sample code in following table.
 
SfRichTextBoxAdv.NewDocumentCommand.Execute(null, richTextBoxAdv); 
 
Please try this sample code and let us know if this helps you.

 
Regards,
Venkatesan M. 


Bernd
Replied On December 14, 2016 03:27 AM

Hi Venkatesan,

thank you for your hint with NewDocumentCommand . This way I can bypass the problem.

But the question remains if it is a bug in Load() for an empty stream or if I am doing something wrong?

However my app does not hang anymore. :-) So feel free to close this issue.

Regards
Bernd

Venkatesan Mani [Syncfusion]
Replied On December 15, 2016 01:10 AM

Hi Bernd,

Thank you for your update.

We are glad to know that your issue has been resolved with the solution provided. We are unable to reproduce the issue reported in the previous update. The empty strings/streams are loaded properly in our SfRichTextBoxAdv control with the latest version 14.4.0.15. Could you please let us know which version your using?

Regards,
Venkatesan M. 


Bernd
Replied On December 15, 2016 03:45 AM

Hi Venkatesan,

I am using the latest version (v14.4.0.15).

The problem occurs, when I load am empty string more than once. Meanwhile the view using the control is hidden and shown again.

There may also be a problem in my code, I cannot rule that out. Does the error message give you any hint?

Regards
Bernd

Venkatesan Mani [Syncfusion]
Replied On December 16, 2016 12:55 AM

Hi Bernd,

Thank you for your update.

We are afraid that we are not able to reproduce the reported issue with the latest version of SfRichTextBoxAdv control Could you please share us the simple sample to reproduce this issue or the code handled in SfRichTextBoxAdv extension class and property binding? So, that we can investigate further and provide you the appropriate solution at the earlier.

Regards,
Venkatesan M.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;