Skip to main content

GlobalOptions.BootstrapVersion Property

Specifies the Bootstrap version.

Namespace: DevExpress.Blazor.Configuration

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(BootstrapVersion.v4)]
public BootstrapVersion BootstrapVersion { get; set; }

Property Value

Type Default Description
BootstrapVersion v4

A BootstrapVersion enumeration value.

Available values:

Name Description
v4

Bootstrap v4

v5

Bootstrap v5

Remarks

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). You need to set the BootstrapVersion global option to v5 (Program.cs).

Set up the BootstrapVersion Property

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