How do I delete the contents of a RichTextBox and add new contents?
I am retrieving multiple sections of data from a database. The RichTextBox displays the first section from the database.
The customer hits the Next button ... the RichTextBox should display the second section from the database. The following code concatenates the second section to the first section.
gRTbx.Document.Blocks.Clear();
gobjParagaph.Inlines.Add(new Run(st));
gobjFlowDoc.Blocks.Add(gobjParagaph);
gRTbx.Document = gobjFlowDoc;
I also tried placing this before adding to the RichTextBox.
gobjFlowDoc.Blocks.Clear();
How do I remove the first section from the RichTextBox ... then display the second section?
How do I delete the contents of a RichTextBox and add new co
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Clyde Eisenbeis105 pointsPosted Feb 20, 2015, 3:34 AM EST
gobjFlowDocs.Blocks.Clear()