Back to Devexpress

Section.HasFooter(HeaderFooterType) Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-section-dot-hasfooter-x28-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-headerfootertype-x29.md

latest6.8 KB
Original Source

Section.HasFooter(HeaderFooterType) Method

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

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
bool HasFooter(
    HeaderFooterType type
)
vb
Function HasFooter(
    type As HeaderFooterType
) As Boolean

Parameters

NameTypeDescription
typeHeaderFooterType

A HeaderFooterType enumeration value specifying the footer type.

|

Returns

TypeDescription
Boolean

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

|

Remarks

When a new footer is created using the Section.BeginUpdateFooter method without arguments, it is the footer 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 HasFooter method to check for the HeaderFooterType.Primary footer type.

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

Note

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.

word-processing-merge-documents-with-different-headers-and-footers/CS/Helpers/SectionsMerger.cs#L43

csharp
private static void AppendFooter(Section sourceSection, Section targetSection, HeaderFooterType headerFooterType) {
    if (!sourceSection.HasFooter(headerFooterType)) return;

winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/HeaderAndFooter.cs#L53

csharp
// Check whether the document already has a footer (the same footer for all pages).
if (firstSection.HasFooter(HeaderFooterType.Primary)) {
    SubDocument footerDocument = firstSection.BeginUpdateFooter();

winforms-richedit-iterate-through-all-sub-documents/CS/SubDocumentHelper.cs#L34

csharp
}
if (section.HasFooter(headerFooterType))
{

office-file-api-ai-implementation/CS/BusinessObjects/RichEditExtension.cs#L22

csharp
}
if (section.HasFooter(type)) {
    SubDocument footer = section.BeginUpdateFooter(type);

word-document-api-iterate-through-all-sub-documents/CS/SubDocumentHelper.cs#L34

csharp
}
if (section.HasFooter(headerFooterType))
{

word-processing-merge-documents-with-different-headers-and-footers/VB/Helpers/SectionsMerger.vb#L40

vb
Private Shared Sub AppendFooter(ByVal sourceSection As Section, ByVal targetSection As Section, ByVal headerFooterType As HeaderFooterType)
    If Not sourceSection.HasFooter(headerFooterType) Then Return
    Dim source As SubDocument = sourceSection.BeginUpdateFooter(headerFooterType)

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/HeaderAndFooter.vb#L48

vb
' Check whether the document already has a footer (the same footer for all pages).
If firstSection.HasFooter(DevExpress.XtraRichEdit.API.Native.HeaderFooterType.Primary) Then
    Dim footerDocument As DevExpress.XtraRichEdit.API.Native.SubDocument = firstSection.BeginUpdateFooter()

winforms-richedit-iterate-through-all-sub-documents/VB/SubDocumentHelper.vb#L30

vb
If section.HasFooter(headerFooterType) Then
    Dim footer As SubDocument = section.BeginUpdateFooter(headerFooterType)

word-document-api-iterate-through-all-sub-documents/VB/SubDocumentHelper.vb#L30

vb
If section.HasFooter(headerFooterType) Then
    Dim footer As SubDocument = section.BeginUpdateFooter(headerFooterType)

See Also

BeginUpdateFooter

Section Interface

Section Members

DevExpress.XtraRichEdit.API.Native Namespace