The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

Section.HasHeader(HeaderFooterType) Method

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

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v19.2.Core.dll

Declaration

bool HasHeader(
    HeaderFooterType type
)
Function HasHeader(
    type As HeaderFooterType
) As Boolean
bool HasHeader(
    HeaderFooterType type
)
Function HasHeader(
    type As HeaderFooterType
) As Boolean
bool HasHeader(
    HeaderFooterType type
)
Function HasHeader(
    type As HeaderFooterType
) As Boolean

Parameters

Name Type Description
type HeaderFooterType

A HeaderFooterType enumeration value specifying the header type.

Parameters

Name Type Description
type HeaderFooterType

A HeaderFooterType enumeration value specifying the header type.

Parameters

Name Type Description
type HeaderFooterType

A HeaderFooterType enumeration value specifying the header type.

Returns

Type Description
Boolean

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

Returns

Type Description
Boolean

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

Returns

Type Description
Boolean

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

Remarks

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.

Examples

Document document = server.Document;
Section firstSection = document.Sections[0];
// Create an empty header.
SubDocument newHeader = firstSection.BeginUpdateHeader();
firstSection.EndUpdateHeader(newHeader);
// Check whether the document already has a header (the same header for all pages).
if (firstSection.HasHeader(HeaderFooterType.Primary))
{
    SubDocument headerDocument = firstSection.BeginUpdateHeader();
    document.ChangeActiveDocument(headerDocument);
    document.CaretPosition = headerDocument.CreatePosition(0);
    firstSection.EndUpdateHeader(headerDocument);
}
See Also