Skip to content

fix: HeaderCellAsButtonWithMenu and ColumnOptions set but no sorting results in no menu shown #3309

@davhdavh

Description

@davhdavh

🐛 Bug Report

if ((Sortable is true || IsDefaultSortColumn) && (Grid.ResizableColumns || ColumnOptions is not null))
{
_isMenuOpen = !_isMenuOpen;
}
does not call StateHasChanged and thus the menu is never shown.

💻 Repro or Code Sample

<FluentDataGrid RowStyle="@(x => $"height:{(int)DataGridRowSize.Medium}px;")"
                HeaderCellAsButtonWithMenu="true"
                ResizableColumns="true"
                ResizeType="DataGridResizeType.Discrete"
>
    <TemplateColumn TGridItem="TGridItem" Sortable="false" Title="Actions" Align="@Align.End" Width="120px" Filtered="true">
     <ChildContent>
      Hello world
   </ChildContent>
     <ColumnOptions>Column Options</ColumnOptions>
    </TemplateColumn>
</FluentDataGrid>

🤔 Expected Behavior

clicking on TemplateColumn header shows Column Options and resize.

😯 Current Behavior

Nothing happens on click

💁 Possible Solution

Call StateHasChanged after changing property.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions