Skip to main content

DxTabPage Class

A tab with content within a Tabs component.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.1.dll

NuGet Package: DevExpress.Blazor


public class DxTabPage :


The DxTabPage allows you to create a tab with content within the DxTabs component.

    @foreach (var employee in Employees)
        <DxTabPage Text="@(employee.FirstName + ' ' +  employee.LastName)">
            <div class="media demo-tab-page-content">
                <img src="@(StaticAssetUtils.GetImagePath($"Employees/{employee.FileName}.png"))" width="125" />
                <div class="media-body pl-3">
                    <h5 class="mt-0">@employee.Title @employee.FirstName @employee.LastName</h5>
                    <p><b>Birthday:</b> @employee.BirthDate.ToShortDateString()</p>
@code {
    IEnumerable<Employee> Employees;

    protected override async Task OnInitializedAsync()
        Employees = (await EmployeeService.Load()).Skip(5).Take(3);

Navigation Landing Tab

Run Demo: Tabs - Tab Pages Watch Video: Get Started with Tabs

A tab page can include other DevExpress Blazor components. The following code creates a tab page with the DxGrid component.

<DxTabs style="width:950px">
    <DxTabPage Text="Description">
        <div class="p-3">
            <b>7-Day Weather Forecast</b>
    <DxTabPage Text="Forecast">
        <div class="py-3">
            <DxGrid Data="@Data" CustomizeElement="Grid_CustomizeElement">
                    <DxGridDataColumn FieldName=@nameof(WeatherForecast.Date) />
                    <DxGridDataColumn FieldName=@nameof(WeatherForecast.TemperatureC) Caption="Temp. (C)" />
                    <DxGridDataColumn FieldName=@nameof(WeatherForecast.TemperatureF) Caption="Temp. (F)" />
                    <DxGridDataColumn FieldName="@nameof(WeatherForecast.CloudCover)" />
                    <DxGridDataColumn FieldName="@nameof(WeatherForecast.Precipitation)">
                            <DxCheckBox Enabled="false" Checked="(bool)context.Value" />

@code {
    void Grid_CustomizeElement(GridCustomizeElementEventArgs args) {
        if (args.ElementType == GridElementType.DataCell && args.Column is IGridDataColumn dataColumn && dataColumn.FieldName == "Precipitation")
            args.CssClass = "p-0";

    public class WeatherForecast {
        public DateTime Date { get; set; }
        public int TemperatureC { get; set; }
        public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
        public string CloudCover { get; set; }
        public bool Precipitation { get; set; }
    String[] CloudCover = { "Sunny", "Partly cloudy", "Cloudy", "Storm" };
    object Data;

    public Task<IEnumerable<WeatherForecast>> GetForecastAsync(CancellationToken ct = default) {
        var rng = new Random();
        DateTime startDate = DateTime.Now;
        return Task.FromResult(Enumerable.Range(1, 7).Select(index => new WeatherForecast {
            Date = startDate.AddDays(index),
            TemperatureC = rng.Next(-15, 20),
            CloudCover = CloudCover[rng.Next(0, CloudCover.Length)],
            Precipitation = Convert.ToBoolean(rng.Next(0, 2))

    protected override async Task OnInitializedAsync() {
        Data = await GetForecastAsync();

Tabs With Data Grid


See Also