Hi,
I have a RadRichTextBox on a usercontrol. When the user creates new record, the info in RadRichTextBox is written in Normal font style and black color. However, when the user later on reopens it to edit the record, the extra info added in RadRichTextBox is written in Bold Italic and Red color.
My code is following for the edit case:
I have a RadRichTextBox on a usercontrol. When the user creates new record, the info in RadRichTextBox is written in Normal font style and black color. However, when the user later on reopens it to edit the record, the extra info added in RadRichTextBox is written in Bold Italic and Red color.
My code is following for the edit case:
//Span span = new Span(""); //Does not work
//Span span = new Span(" "); // Does not work
Span span = new Span(": "); // This works but adds this extra colon ":"
span.ForeColor = Colors.Red;
span.FontWeight = FontWeights.Bold;
span.FontStyle = FontStyles.Italic;
span.FontFamily = new FontFamily("Tahoma");
span.FontSize = Unit.PointToDip(10);
Paragraph paragraph = _radRichTextBox.Document.Sections.Last.Blocks.Last as Paragraph;
paragraph.Inlines.Add(span);
_radRichTextBox.UpdateEditorLayout();
There are two issues:
1) If I define a blank span or a span with only a spance in it, then the RadRichTextBox does not write the text with the new font changes (color, shape, size stays as the original one).
2) While typing, it adds one character at the end of the document (in that new span) but then it jumps to the beginning of the document in RadTextBox. Then we have to take the cursor again to the end to continue typing text.
Is there any way, the above issues could be resolved.
Thank you,
Sarfraz.
(Version: 2011.1.419.1040)