ViewInfo2.IsDefault property

Office 2013 and later

Gets or sets a value that indicates whether the view is defined as the default view in a Microsoft InfoPath form.

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

bool IsDefault { get; set; }

Property value

Type: System.Boolean
true if the view is the default view; otherwise false.

Implements

ViewInfo.IsDefault

The IsDefault property of the ViewInfoObject object can be used to determine whether a view is the default view, and it can be used to programmatically change the default view before the first view is loaded.

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

In the following example, the IsDefault property is used to make the second view contained in the ViewInfosCollection collection the default view:

thisXDocument.ViewInfos[1].IsDefault = true;
Show: