Hi. Here is my scenario:
User inserts some small text blocks into RadRichTextBox like this: "[name]" or "[address]". These are templates which can contain empty spaces inside: "[full name]".
User may want to edit any template. He moves caret cursor on template text to specify the template he wants to change.
When the whole template is located in one line, it's ok - I can take current span box and change the text inside:
But when the text is long it can be wrapped in two or more lines (without paragraphs). Then the current span box will contain only some part of template. It looks like every line of text in RadRichTextBox is a different span even if paragraph is the same.
1. How can I identify the whole template in this case?
2. How can I replace the template if it is divided into several spans?
Thank you.
User inserts some small text blocks into RadRichTextBox like this: "[name]" or "[address]". These are templates which can contain empty spaces inside: "[full name]".
User may want to edit any template. He moves caret cursor on template text to specify the template he wants to change.
When the whole template is located in one line, it's ok - I can take current span box and change the text inside:
SpanLayoutBox currentSpanBox = RadRichTextBox.Document.CaretPosition.GetCurrentSpanBox();
currentSpanBox.Text = "New value";
But when the text is long it can be wrapped in two or more lines (without paragraphs). Then the current span box will contain only some part of template. It looks like every line of text in RadRichTextBox is a different span even if paragraph is the same.
1. How can I identify the whole template in this case?
2. How can I replace the template if it is divided into several spans?
Thank you.