To customize the appearance of icons, you can override their styles by adjusting the opacity settings.
In this example, a custom class called custom-grid
has been added to the grid to specifically target MudDataGrid
s with that class for styling overrides.
<style>
.custom-grid .mud-table-cell .column-header .column-options .sort-direction-icon,
.custom-grid .mud-table-cell .column-header .column-options .mud-menu .mud-icon-button-label
{
opacity: 1 !important;
}
</style>
<MudDataGrid T="Element" Items="@Elements" SortMode="@_sortMode" Class="custom-grid">
<Columns>
<PropertyColumn Property="x => x.Number" Title="Nr" Sortable="false" />
<PropertyColumn Property="x => x.Sign" />
<PropertyColumn Property="x => x.Name" SortBy="@_sortBy" />
<PropertyColumn Property="x => x.Position" />
<PropertyColumn Property="x => x.Molar" Title="Molar mass" />
<PropertyColumn Property="x => x.Group" Title="Category" />
<TemplateColumn Title="Custom" SortBy="@(x => $"{x.Sign} - {x.Name}")">
<CellTemplate>
@context.Item.Sign - @context.Item.Name
</CellTemplate>
</TemplateColumn>
</Columns>
<PagerContent>
<MudDataGridPager T="Element" />
</PagerContent>
</MudDataGrid>
Check out this MudBlazor Snippet
https://i.sstatic.net/kjbag.png
I identified the classes and styles used in the MudDataGrid from the SCSS file on GitHub. See GitHub link for more details.