Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Paragraph

#Insert a paragraph at the cursor position

var subDocument = richEdit.selection.activeSubDocument;
var position = richEdit.selection.active;
var paragraph = subDocument.insertParagraph(position);

#Apply properties to a paragraph

var subDocument = richEdit.selection.activeSubDocument;
var position = richEdit.selection.active;

richEdit.history.beginTransaction();
richEdit.beginUpdate();  
var textInterval = subDocument.insertText(position, "Centered text");
subDocument.paragraphs.find(textInterval).forEach(function (paragraph) {
    paragraph.properties = { 
        alignment: DevExpress.RichEdit.ParagraphAlignment.Center,
    }; 
});
richEdit.endUpdate();  
richEdit.history.endTransaction();