Unplanned
Last Updated: 30 Oct 2018 14:16 by ADMIN
ADMIN
Tanya
Created on: 30 Oct 2018 14:13
Category: RichTextBox
Type: Bug Report
1
RichTextBox: Current editing style is reset to default values when changing paragraph indent on an empty paragraph
The properties applied locally to the content are not preserved and used for the new content when the user changes the paragraph indent.

Workaround: Keep the properties in a variable and apply them after executing the command:

StyleDefinition style;

private void RadRichTextBox_CommandExecuted(object sender, CommandExecutedEventArgs e)
{
    if (e.Command is IncrementParagraphLeftIndentCommand)
    {
        this.radRichTextBox.CurrentEditingStyle.CopyPropertiesFrom(style);
    }
}
        
private void RadRichTextBox_CommandExecuting(object sender, Telerik.Windows.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
{
    if (e.Command is IncrementParagraphLeftIndentCommand)
    {
        style = new StyleDefinition(this.radRichTextBox.CurrentEditingStyle);
    }
}
0 comments