Feature Request: MaxWidth property for DataGridColumn

I'm working with RadzenDataGrid and have a scenario where I need to constrain a column's width both minimum and maximum. Specifically, I have an actions column that shows either one or two icons conditionally:

<RadzenDataGridColumn TItem="LedgerItem"
                     Frozen="true"
                     Title=""
                     TextAlign="TextAlign.Center"
                     MinWidth="40px"
                     Width="70px">
    <Template Context="data">
        <div class="d-flex justify-content-center gap-1">
            @if (isConnected)
            {
                <button class="btn btn-link p-0 me-1"
                        @onclick="() => OnSync(data)"
                        title=@(data.IsSynced ? "Resync" : "Sync")>
                    <i class="fa-solid fa-sync @(data.IsSynced ? "text-success" : "text-muted")"
                       style="font-size: 0.875rem;"></i>
                </button>
            }
            <button class="btn btn-link p-0"
                    @onclick="() => OnEdit(data)"
                    title="Edit">
                <i class="fa-solid fa-pen text-muted"
                   style="font-size: 0.875rem;"></i>
            </button>
        </div>
    </Template>
</RadzenDataGridColumn>

Current workaround:
I can achieve this using CSS, but prefer not to manage additional CSS classes.

Feature Request: Would it be possible to add a MaxWidth property to match the existing MinWidth property? This would provide a more consistent API and allow for cleaner column width constraints directly through component properties rather than CSS.

Environment:

  • Project Type: Blazor Server
  • Subscription: Professional

Thank you for considering this request!

Hi @karacif,

Just logged it as a feature request. We would hopefully implement it soon (cannot commit with an exact ETA yet).

1 Like