How do I collapse Blazor Grid groupings by default and/or programmatically?
Hello,
Try to set IsGroupExpandedDefault to false.
<DataGrid @ref=@DataGridRef Height="100%" Width="100%" DataSource="@DataSource" AutoGenerateColumns="false" IsGroupExpandedDefault="false" IsGroupCollapsable="true"
....>
I already have that attribute set but when it renders at runtime all the groupings are expanded. How can I have all the groupings collapsed by default?
You would need to set ‘IsGroupCollapsable’ property of the grid, something like this:
<DataGrid @ref="DataGridRef" Height="100%" Width="100%" DataSource="DataSource" IsGroupCollapsable="true" />
Refer to this online help document for more information.
Sincerely,
Divya Jain