Back to Devexpress

ToolbarParagraphFormattingEdit Class

aspnet-devexpress-dot-web-dot-aspxhtmleditor-a830c4cd.md

latest5.8 KB
Original Source

ToolbarParagraphFormattingEdit Class

A default toolbar editor that allows a predefined paragraph style to be applied to the selected paragraph within the design view area.

Namespace : DevExpress.Web.ASPxHtmlEditor

Assembly : DevExpress.Web.ASPxHtmlEditor.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public class ToolbarParagraphFormattingEdit :
    ToolbarComboBoxBase
vb
Public Class ToolbarParagraphFormattingEdit
    Inherits ToolbarComboBoxBase

Remarks

The ASPxHtmlEditor allows end-users to set a paragraph formatting for the editor’s selected text by using the Paragraph button. Clicking this button opens a drop down window with predefined paragraph styles.

You can add the Paragraph button to toolbars by using either the ASPxHtmlEditor designer at design time, or programmatically.

csharp
protected void Page_Load(object sender, EventArgs e) {
    HtmlEditorToolbar stToolbar1 = HtmlEditorToolbar.CreateStandardToolbar1();
    ToolbarParagraphFormattingEdit paragButton = new ToolbarParagraphFormattingEdit();
    ToolbarListEditItem item1 = new ToolbarListEditItem();
    item1.Text = "Normal";
    item1.Value = "p";
    ToolbarListEditItem item2 = new ToolbarListEditItem();
    item2.Text = "Heading 1";
    item2.Value = "h1";
    ToolbarListEditItem item3 = new ToolbarListEditItem();
    item3.Text = "Heading 2";
    item3.Value = "h2";
    ToolbarListEditItem item4 = new ToolbarListEditItem();
    item4.Text = "Heading 3";
    item4.Value = "h3";
    ToolbarListEditItem item5 = new ToolbarListEditItem();
    item5.Text = "Heading 4";
    item5.Value = "h4";
    ToolbarListEditItem item6 = new ToolbarListEditItem();
    item6.Text = "Heading 5";
    item6.Value = "h5";
    ToolbarListEditItem item7 = new ToolbarListEditItem();
    item7.Text = "Heading 6";
    item7.Value = "h6";
    ToolbarListEditItem item8 = new ToolbarListEditItem();
    item8.Text = "Address";
    item8.Value = "address";
    ToolbarListEditItem item9 = new ToolbarListEditItem();
    item9.Text = "Normal (DIV)";
    item9.Value = "div";
    paragButton.Items.Add(item1);
    paragButton.Items.Add(item2);
    paragButton.Items.Add(item3);
    paragButton.Items.Add(item4);
    paragButton.Items.Add(item5);
    paragButton.Items.Add(item6);
    paragButton.Items.Add(item7);
    paragButton.Items.Add(item8);
    paragButton.Items.Add(item9);
    stToolbar1.Items.Add(paragButton);
    ASPxHtmlEditor1.Toolbars.Add(stToolbar1);
}
aspx
<dx:ASPxHtmlEditor ID="ASPxHtmlEditor1" runat="server">
    <Toolbars>
        <dx:HtmlEditorToolbar Name="StandardToolbar1">
            <Items>
                <dx:ToolbarParagraphFormattingEdit Width="120px">
                    <Items>
                        <dx:ToolbarListEditItem Text="Normal" Value="p" />
                        <dx:ToolbarListEditItem Text="Heading 1" Value="h1" />
                        <dx:ToolbarListEditItem Text="Heading 2" Value="h2" />
                        <dx:ToolbarListEditItem Text="Heading 3" Value="h3" />
                        <dx:ToolbarListEditItem Text="Heading 4" Value="h4" />
                        <dx:ToolbarListEditItem Text="Heading 5" Value="h5" />
                        <dx:ToolbarListEditItem Text="Heading 6" Value="h6" />
                        <dx:ToolbarListEditItem Text="Address" Value="address" />
                        <dx:ToolbarListEditItem Text="Normal (DIV)" Value="div" />
                    </Items>
                </dx:ToolbarParagraphFormattingEdit>
            </Items>
        </dx:HtmlEditorToolbar>
    </Toolbars>
</dx:ASPxHtmlEditor>

Implements

IStateManager

IPropertiesOwner

IExpressionsAccessor

Inheritance

Object StateManager CollectionItem ToolbarItemBase HtmlEditorToolbarItem ToolbarDropDownBase ToolbarComboBoxBase ToolbarParagraphFormattingEdit

See Also

ToolbarParagraphFormattingEdit Members

HTML Editor

Default Toolbar Items

Menu Toolbar Items

Html Editor Designer

DevExpress.Web.ASPxHtmlEditor Namespace