Completed
Last Updated: 13 Dec 2021 11:51 by ADMIN
Release R1 2021
Dimitar
Created on: 16 Dec 2020 11:15
Category: RichTextEditor
Type: Bug Report
0
RichTextEditor: The paragraphs in the table are inheriting the negative indent from the previous paragraph

The paragraphs in the table are inheriting the negative indent from the previous paragraph.

Workaround: Manually remove the negative indent from the table paragraphs after the table is added.

The workaround in code:

private void RadRichTextEditor1_CommandExecuted(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutedEventArgs e)
{
    if (e.Command is InsertTableCommand)
    {
        var table = radRichTextEditor1.Document.CaretPosition.GetCurrentTable();
       
        table.TableIndent = 0;  
        
        if (table != null)
        {
            foreach (var row in table.Rows)
            {
                foreach (var cell in row.Cells)
                {
                    foreach (var block in cell.Blocks)
                    {
                        var paragrpah = block as Paragraph;
                        if (paragrpah != null && paragrpah.LeftIndent < 0)
                        {
                            paragrpah.LeftIndent = 0;
                            paragrpah.HangingIndent = 0;
                        }
                    }
                }
            }
        }
        radRichTextEditor1.RichTextBoxElement.Document.UpdateLayout();
    }
}



 

0 comments