officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-section-dot-endupdateheader-x28-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-subdocument-x29.md
Finalizes editing of the section’s header.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
void EndUpdateHeader(
SubDocument document
)
Sub EndUpdateHeader(
document As SubDocument
)
| Name | Type | Description |
|---|---|---|
| document | SubDocument |
A SubDocument instance, representing the header open for editing.
|
Use the Section.BeginUpdateHeader - Section.EndUpdateHeader method pair to edit header content.
Document document = server.Document;
document.AppendSection();
Section firstSection = document.Sections[0];
// Modify the header of the HeaderFooterType.First type.
SubDocument myHeader = firstSection.BeginUpdateHeader(HeaderFooterType.First);
DocumentRange range = myHeader.InsertText(myHeader.CreatePosition(0), " PAGE NUMBER ");
Field fld = myHeader.Fields.Create(range.End, "PAGE \\* ARABICDASH");
myHeader.Fields.Update();
firstSection.EndUpdateHeader(myHeader);
// Display the header of the HeaderFooterType.First type on the first page.
firstSection.DifferentFirstPage = true;
Dim document As Document = server.Document
document.AppendSection()
Dim firstSection As Section = document.Sections(0)
' Modify the header of the HeaderFooterType.First type.
Dim myHeader As SubDocument = firstSection.BeginUpdateHeader(HeaderFooterType.First)
Dim range As DocumentRange = myHeader.InsertText(myHeader.CreatePosition(0), " PAGE NUMBER ")
Dim fld As Field = myHeader.Fields.Create(range.End, "PAGE \* ARABICDASH")
myHeader.Fields.Update()
firstSection.EndUpdateHeader(myHeader)
' Display the header of the HeaderFooterType.First type on the first page.
firstSection.DifferentFirstPage = True
The following code snippets (auto-collected from DevExpress Examples) contain references to the EndUpdateHeader(SubDocument) 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.
wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/HeaderAndFooterActions.cs#L18
SubDocument newHeader = firstSection.BeginUpdateHeader();
firstSection.EndUpdateHeader(newHeader);
// Check whether the document already has a header (the same header for all pages).
word-document-api-examples/CS/CodeExamples/HeaderAndFooterActions.cs#L27
newHeader.AppendText("Header");
firstSection.EndUpdateHeader(newHeader);
}
winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/HeaderAndFooter.cs#L23
headerDocument.AppendText("Header");
firstSection.EndUpdateHeader(headerDocument);
}
word-processing-merge-documents-with-different-headers-and-footers/CS/Helpers/SectionsMerger.cs#L38
sourceSection.EndUpdateHeader(source);
targetSection.EndUpdateHeader(target);
word-document-api-use-track-changes/CS/word-processing-document-api-track-changes/Program.cs#L39
documentRevisions.RejectAll(header);
documentProcessor.Document.Sections[0].EndUpdateHeader(header);
word-document-api-examples/VB/CodeExamples/HeaderAndFooterActions.vb#L24
newHeader.AppendText("Header")
firstSection.EndUpdateHeader(newHeader)
End If
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/HeaderAndFooter.vb#L21
headerDocument.AppendText("Header")
firstSection.EndUpdateHeader(headerDocument)
End If
wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/HeaderAndFooterActions.vb#L15
Dim newHeader As SubDocument = firstSection.BeginUpdateHeader()
firstSection.EndUpdateHeader(newHeader)
' Check whether the document already has a header (the same header for all pages).
word-processing-merge-documents-with-different-headers-and-footers/VB/Helpers/SectionsMerger.vb#L35
target.Delete(emptyParagraph)
sourceSection.EndUpdateHeader(source)
targetSection.EndUpdateHeader(target)
word-document-api-insert-inline-pictures/VB/InlinePictures/Program.vb#L37
docHeader.Images.Append(DocumentImageSource.FromUri(imageUri, server))
doc.Sections(0).EndUpdateHeader(docHeader)
' Insert a barcode.
See Also