Hello,
I have a RadDocument and want to exchange a specific text against a table with the same HorizontalAlignment and other style properties. i.e.:
some text some text some text some text
some text some text some text some text
"centered bold text"
some text some text some text some text
some text some text some text some text
(the text "centered bold text" have to exchange against my table withHorizontalAlignment = Center and FontWeight = Bold)
TextRange rt = search.FindAll(
"centered bold text"
).First();
document.CaretPosition.MoveToPosition(rt.StartPosition);
document.Selection.AddSelectionStart(rt.StartPosition);
document.Selection.AddSelectionEnd(rt.EndPosition);
How can I get information about the style settings of the text at the CaretPosition?
The insertion of the table isn't without styles works:
RadDocumentEditor editor =
new
RadDocumentEditor(document);
// How to get the styles
editor.Delete(
false
);
Table table = GetSomeTelerikTable();
// How to set the style - especially Horizontal alignment for center/right
// table.HorizontalAlignment = RadHorizontalAlignment.Center;
editor.InsertTable(table);
...
// I tried the following for a fixed value of HorizontalAlignment, but this didn't work:
//editor.ChangeTableHorizontalAlignment(RadHorizontalAlignment.Center);
...
document.MeasureAndArrangeInDefaultSize();
How can I set this style properties for my new table?
Thanks a lot