Skip to main content
.NET Framework 4.5.2+

Section.HasHeader(HeaderFooterType) Method

Gets whether a section has a header of the specified type.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v22.1.Core.dll


bool HasHeader(
    HeaderFooterType type


Name Type Description
type HeaderFooterType

A HeaderFooterType enumeration value specifying the header type.


Type Description

true, if the section has a header of the specified type; otherwise, false.


When a new header is created using the Section.BeginUpdateHeader method without arguments, it is the header of the HeaderFooterType.Primary type which is the same for all pages, unless the Section.DifferentFirstPage or the Document.DifferentOddAndEvenPages properties are set to true. So in this situation, you can use the HasHeader method to check for the HeaderFooterType.Primary header type.


using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer())
Document document = wordProcessor.Document;
    Section firstSection = document.Sections[0];

    // Check whether the document already has a header (the same header for all pages).
    if (!firstSection.HasHeader(HeaderFooterType.Primary))
        //If not, create an empty header.
        SubDocument headerDocument = firstSection.BeginUpdateHeader();

The following code snippets (auto-collected from DevExpress Examples) contain references to the HasHeader(HeaderFooterType) method.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also