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

Undo or History Stack object

2 Answers 179 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 17 Mar 2011, 05:57 PM
Hello,

I'm currently using a single RTB instance to accommodate multiple documents without any issues. For obvious reasons the Undo/History stack for each instance gets lost between document loads. Is there any kind of Undo or History Stack object property of the RichTextBoxUI that I can bind to my ViewModel (and indirectly my data model) to carry this information around?

Any help would be greatly appreciated.

Thanks,

2 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 23 Mar 2011, 10:32 AM
Hi Scott,

You cannot manipulate the history directly, but you can keep a separate RadRichTextBox for every document.
Then, instead of binding the content of one rich text box, you will choose which rich text box you want to show, either by changing its visibility or by manipulating the visual tree - adding/removing rich text boxes to/from the children of the panel that you want to show the rich text box in. Please note that this might carry a relatively large memory usage penalty if a lot of instances are involved.

Regards,
Iva
the Telerik team
0
Scott
Top achievements
Rank 1
answered on 23 Mar 2011, 03:16 PM
Thanks Iva,

That was my original strategy, of instantiating a new RadRichTextBox on each document change (and disposing of the previous) however the end user experience was far less than ideal on document changes. I guess I can live without the persistent document-scoped history stack for now.

Thanks for your help.
Tags
RichTextBox
Asked by
Scott
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Scott
Top achievements
Rank 1
Share this question
or