Skip to main content
All docs
V25.1
  • Configure View Settings

    • 4 minutes to read

    Important

    The DevExpress Presentation API Library is currently available as a Community Technology Preview (CTP). Note that we do not recommend that you integrate pre-release libraries into mission-critical software applications. You can try the library and share your feedback so that we can make necessary adjustments before the official release. To start a conversation, submit a ticket via the DevExpress Support Center — we’d love to hear from you.

    This article describes how to configure various view settings in the DevExpress Presentation API. It also includes links to the relevant API members that you can use to customize the presentation’s appearance and behavior.

    Set the Active View

    Use the Presentation.ViewProperties.ActiveViewType property to specify the default view used when an application displays the presentation. You can choose from the following views:

    Example

    The following code snippet defines the view an application displays when a user opens the presentation:

    using (Presentation presentation = new Presentation("document.pptx")) {
        presentation.ViewProperties.ActiveViewType = ViewType.HandoutView;
    }
    

    Adjust Grid Spacing

    DevExpress Presentation API includes the GridSpacing property that allows you to adjust grid spacing settings for a view.

    DevExpress Presentation - View Properties - Grid Spacing

    This property applies to all views mentioned above, except for SlideSorterView.

    Example

    The following code sample sets the Presentation.ViewProperties.GridSpacing property value to 50:

    DevExpress Presentation - View Properties - Grid Spacing

    using (Presentation presentation = new Presentation("document.pptx")) {
        presentation.ViewProperties.GridSpacing = 500;
    }
    

    Customize the Normal View

    The normal view consists of three content regions: the slide view, the thumbnails pane, and the notes pane.

    DevExpress Presentation - Normal View

    DevExpress Presentation API includes the NormalViewProperties class that allows you to customize the following settings of the normal view:

    Presentation.NormalViewProperties.RestoredLeft
    Gets or sets the size of the thumbnails pane in the normal view (when the pane is not minimized or maximized).
    Presentation.NormalViewProperties.RestoredTop
    Gets or sets the height of the slide area in the normal view (when the slide area is not minimized or maximized).
    Presentation.NormalViewProperties.ShowOutlineIcons
    Gets ot sets whether the application should show icons if it displays outline content in any content region in normal view mode. Applications may ignore this setting.
    Presentation.NormalViewProperties.HorizontalBarState
    Gets or sets the state of the horizontal splitter bar (separates the slide area from the notes pane).
    Presentation.NormalViewProperties.VerticalBarState
    Gets or sets the state of the vertical splitter bar (separates the slide area from the thumbnails pane).
    Presentation.NormalViewProperties.SnapVerticalSplitter
    Gets or sets whether the vertical splitter should be minimized if the side region has an insufficient size. Applications may ignore this setting.
    Presentation.NormalViewProperties.UseSingleView
    Gets or sets whether to display slide area only (hide thumbnails and notes).

    Tip

    Refer to property descriptions above for code samples.

    Examples

    Collapse the Thumbnails Pane

    The following code snippet collapses the thumbnails pane (sets Size to 0.0) and disables automatic size adjustment:

    DevExpress Presentation Views - Collapse Side Content Region

    using (Presentation presentation = new Presentation("document.pptx")) {
        NormalViewRestoredProperties viewProps = new NormalViewRestoredProperties(0.0, false);
        presentation.ViewProperties.NormalViewProperties.RestoredLeft = viewProps;
    }
    

    Display a Single Slide View

    The following code snippet displays a single slide view:

    DevExpress Presentation Views - Show Single View

    using (Presentation presentation = new Presentation("document.pptx")) {
        presentation.ViewProperties.NormalViewProperties.UseSingleView = true;
    }
    

    Customize Slide and Notes Regions

    DevExpress Presentation API includes the CommonSlideViewProperties class. Use its members to customize Slide or Notes regions. Any changes you make apply to all views that contain these regions. The following settings are available:

    Presentation.CommonSlideViewProperties.DrawingGuides
    Gets the drawing guide collection.
    Presentation.CommonSlideViewProperties.Scale
    Gets or sets the view scaling ratio as a percentage. Applications may ignore this setting.
    Presentation.CommonSlideViewProperties.VariableScale
    Gets or sets whether the view content should automatically scale to fit the current window. Applications may ignore this setting.

    Example

    The following code snippet creates a vertical drawing guide and adds it to the DrawingGuides collection:

    DevExpress Presentation Views - Drawing Guides

    using (Presentation presentation = new Presentation("document.pptx")) {
        DrawingGuide guide1 = new DrawingGuide(Direction.Vertical, 150);
        presentation.ViewProperties.SlideViewProperties.DrawingGuides.Add(guide1);
    }