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

Exception when using RadRichTextBox in RadGridView

1 Answer 53 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Francois Lamy
Top achievements
Rank 1
Francois Lamy asked on 01 Jul 2011, 07:41 PM
I have a RadGridView set up using EnableRowVirtualization=true.  I override the column's CreateCellElement call and put a data-bound RadRichTextBox in one of the columns.  My problem is that when I clear the ObservableCollection that is bound to the grid, I get an unhandled exception coming out of the GridViewItemContainerGenerator as a result of the RadRichTextBox calling InitActiveEditorPresenter, which sets the owner on the DocumentPresenterBase, which calls OnOwnerChanged, which calls DoOnDocumentChanged, and which calls UpdateEditorLayout().

I cannot figure out how to NOT have this exception occur when I clear my ObservableCollection.  I tried clearing the content from the RadRichTextBox in response to the RowUnloaded event, but I end up getting the same error...

Can anyone share any thoughts on this, or is it too specific?

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 05 Jul 2011, 01:18 PM
Hello Thomas Whittaker,

Thank you for getting to us about this problem. It seems that the data provider tries to update the document of the rich text box when the text property it is bound to changes. When the observable collection is cleared, it tries to instantiate a blank document and show it in the rich text box.
We will look into the cause of the exception and hopefully, fix it on our end. As a workaround, you can implement a RichTextControl that inherits from RadRichTextBox and have it update its document only when the text property shows a valid document, different from the default one. Please find attached a sample demo illustrating the approach.

Greetings,
Iva
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
Tags
RichTextBox
Asked by
Francois Lamy
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or