Skip to main content

GlobalOptions.BootstrapVersion Property

OBSOLETE

This property is obsolete now.

Specifies the Bootstrap version.

Namespace: DevExpress.Blazor.Configuration

Assembly: DevExpress.Blazor.v25.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(BootstrapVersion.v5)]
[Obsolete("This property is obsolete now.")]
public BootstrapVersion BootstrapVersion { get; set; }

Property Value

Type Default Description
BootstrapVersion v5

A BootstrapVersion enumeration value.

Available values:

Name Description
v4

Bootstrap v4

v5

Bootstrap v5

Remarks

Important

The BoostrapVersion global option and the corresponding BootstrapVersion enumeration are now obsolete. You no longer need to set up the BootstrapVersion property for your applications. If you create an application with a DevExpress Blazor project template, the AddDevExpressBlazor method only includes size mode configuration.

The BootstrapVersion property allows you to specify the Bootstrap version for your application. Note that the Bootstrap version of the application and theme should match. Refer to the following topics for more information:

Bootstrap Version in DevExpress Templates

When you use DevExpress project templates to create a Blazor application, the project contains a link to a DevExpress theme v5 (Pages/Layout.cshtml, wwwwroot/index.html, or Components/App.razor) and sets the BootstrapVersion global option to v5 (Program.cs).

Bootstrap Version in Microsoft Templates

When you use Microsoft project templates to create a Blazor application, the project contains a link to the standard Bootstrap theme v5 (Pages/Layout.cshtml, wwwwroot/index.html, or Components/App.razor) and sets the BootstrapVersion global option to v5 (Program.cs).

Set up the BootstrapVersion Property Explicitly

Do any of the following:

  • Call the AddDevExpressBlazor(IServiceCollection, Action<GlobalOptions>) method.

    using DevExpress.Blazor;
    
    builder.Services.AddDevExpressBlazor(configure => configure.BootstrapVersion = BootstrapVersion.v5);
    
  • Call the services.Configure method that registers a configuration instance with the specified global option’s value.

    using DevExpress.Blazor;
    using DevExpress.Blazor.Configuration;
    
    builder.Services.Configure<GlobalOptions>((options) => options.BootstrapVersion = BootstrapVersion.v5);
    
  • Define the global option’s value in the appsettings.json file.

    { 
        "DevExpress": { 
            "BootstrapVersion": "v5" 
        } 
    } 
    

    Call the services.Configure method. Use the ConfigurationBinder.Bind method to register a configuration instance with the specified global option’s value.

    using DevExpress.Blazor;
    using DevExpress.Blazor.Configuration;
    
    builder.Services.Configure<GlobalOptions>(options => builder.Configuration.Bind("DevExpress", options));
    
See Also