Unplanned
Last Updated: 16 Dec 2020 11:16 by ADMIN
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