[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Collapse]Office File API
  Demo Application
  Redistribution and Deployment
 [Expand]Spreadsheet Document API
 [Collapse]Word Processing Document API
   Getting Started
  [Expand]WordProcessing Document
  [Expand]Merge and Split Documents
   Import and Export
  [Expand]Fields
   Text Formatting
  [Expand]Mail Merge
   Printing
   Export to PDF
   Document Protection
   HTML Tag Support
  [Collapse]Examples
   [Expand]Files
   [Expand]Document Conversion
   [Expand]Text
   [Expand]Formatting
   [Expand]Styles
   [Expand]Lists
   [Expand]Pictures
   [Expand]Text Boxes
   [Expand]Tables
   [Collapse]Document Elements
     How to: Insert Bookmark or Hyperlink
     How to: Create, Edit and Delete Comments
     How to: Create and Modify Header
     How to: Specify Document Properties
     How to: Insert and Modify Fields
     How to: Create a Checkbox
     How to: Create a Table of Contents
   [Expand]Layout
   [Expand]Search and Replace
   [Expand]Protection
   [Expand]Printing
   [Expand]Export
 [Expand]PDF Document API
 [Expand]Excel Export Library
 [Expand]Snap Report API
 [Expand]Zip Compression and Archive API
 [Expand]Barcode Generation API
 [Expand]Unit Conversion API
 [Expand]API Reference
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How to: Create and Modify Header

The following article explains how to create and modify a document header.

Expanded Create a Header

To create a document header, select the section where it is going to be located. To check whether this section already has a header, use the Section.HasHeader property.

The Section.BeginUpdateHeader method is used to start the process. It also creates a new header of the specified HeaderFooterType type. If the type is not specified, the HeaderFooterType.Primary header will be created.

To work with the document header, use the Document.ChangeActiveDocument method. Note that if this method is not used, the wrong header can be selected and the follow-up actions may fail.

Use the Section.EndUpdateHeader to finish working with the header.

Expanded Modify Header

To modify the header, specify the section to which the header belongs and use the Section.BeginUpdateHeader method to open it for modifying. To insert additional content to the header, use the SubDocument.InsertText or ShapeCollection.InsertPicture method. Use the Section.EndUpdateHeader to complete the modification.

Is this topic helpful?​​​​​​​