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

Chinese bug

1 Answer 59 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 08 Feb 2011, 07:56 PM
I know RadRichTextBox currently does not support writing in Chinese.

But i need to detect the exception when someone is writing on chinese or other IME input.

I see in the Telerik examples that you can write on chinese and the control not crash. I need something like it.

I try to override the

protected override void OnTextInputUpdate(TextCompositionEventArgs e)
        {
            try
            {
                base.OnTextInputUpdate(e);
            }
            catch(Exception ex){ }
        }
 
of the  RadRichTextBox, but the exceptions is throw before this point.

thank you very much!
Roberto.

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 10 Feb 2011, 07:42 PM
Hello Roberto,

You can implement the desired behavior in the App.xaml.cs file in your application, in the handler for UnhandledException event. Something like this should do the trick:

private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
    // If the app is running outside of the debugger then report the exception using
    // the browser's exception mechanism. On IE this will display it a yellow alert
    // icon in the status bar and Firefox will display a script error.
    if (!System.Diagnostics.Debugger.IsAttached)
    {
  
        // NOTE: This will allow the application to continue running after an exception has been thrown
        // but not handled.
        // For production applications this error handling should be replaced with something that will
        // report the error to the website and stop the application.
        if (e.ExceptionObject.Message == "Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))")
        {
            MessageBox.Show("Writing using IME is currently not supported. Please change your input language.");
        }
        e.Handled = true;
       //Do not report to DOM
       // Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
    }
}

If you have other questions, do not hesitate to contact us again. We will do our best to resolve this problem at our side in the next version.

Regards,
Iva
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
RichTextBox
Asked by
Rob
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or