Demos About Radzen
Search Results for

    Show / Hide Table of Contents

    Class RadzenComponentActivator

    Allows the developer to replace a component with another. Useful to specify default values for component properties.

    Inheritance
    System.Object
    RadzenComponentActivator
    Namespace: Radzen
    Assembly: Radzen.Blazor.dll
    Syntax
    public class RadzenComponentActivator : IComponentActivator
    Examples
    var builder = WebApplication.CreateBuilder(args);
    var activator = new RadzenComponentActivator();
    // Replace RadzenButton with MyButton
    activator.Override<RadzenButton, MyButton>();
    // Replace RadzenDataGrid with MyDataGrid
    activator.Override(typeof(RadzenDataGrid<>), typeof(MyDataGrid<>));
    // Register the activator
    builder.Services.AddSingleton<IComponentActivator>(activator);

    Methods

    CreateInstance(Type)

    Creates a component of the specified type.

    Declaration
    public IComponent CreateInstance(Type componentType)
    Parameters
    Type Name Description
    Type componentType
    Returns
    Type Description
    IComponent

    Override(Type, Type)

    Replaces the specified component type with another.

    Declaration
    public void Override(Type original, Type override)
    Parameters
    Type Name Description
    Type original
    Type override

    Override<TOriginal, TOverride>()

    Replaces the specified component type with another.

    Declaration
    public void Override<TOriginal, TOverride>()
    Type Parameters
    Name Description
    TOriginal
    TOverride

    Introducing Radzen Blazor Studio

    Radzen Blazor Studio is a software development environment that empowers developers to design, build and deploy Blazor applications without the traditional hurdles. Write less code and get more done.

    Learn More

    Download Now
    Download Now
    In This Article
    Back to top Radzen Blazor Components, © 2018-2025 Radzen. Source Code licensed under MIT