Skip to main content

GlobalOptions.SizeMode Property

Specifies DevExpress Blazor components’ size mode.

Namespace: DevExpress.Blazor.Configuration

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(SizeMode.Medium)]
public SizeMode SizeMode { get; set; }

Property Value

Type Default Description
SizeMode Medium

A SizeMode enumeration value.

Available values:

Name Description
Small

Small size.

Medium

Medium size.

Large

Large size.

Remarks

Use the SizeMode global option to specify size mode for Blazor components whose size mode is not defined (set to NULL).

Do any of the following to specify this option:

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

    using DevExpress.Blazor;
    
    builder.Services.AddDevExpressBlazor(configure => configure.SizeMode = DevExpress.Blazor.SizeMode.Small);
    
  • 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.SizeMode = SizeMode.Small);
    
  • Define the global option’s value in the appsettings.json file.

    { 
        "DevExpress": { 
            "SizeMode": "Small" 
        } 
    } 
    

    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));
    

For more information, refer to Size Modes.

See Also