Skip to content

Commit

Permalink
-FluentMenu change from #2579 had commented Parameter attribute
Browse files Browse the repository at this point in the history
- Add 2024 Olymics data and set examples to use that
  • Loading branch information
vnbaaij committed Aug 26, 2024
1 parent d0ce14d commit 8496705
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6032,7 +6032,6 @@
<summary>
Gets or sets the horizontal scaling mode.
</summary>
[Parameter]
</member>
<member name="M:Microsoft.FluentUI.AspNetCore.Components.FluentMenu.OnAfterRenderAsync(System.Boolean)">
<summary />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@inject NavigationManager NavManager

<div style="height: 434px; overflow:auto;" tabindex="-1">
<FluentDataGrid Loading="true" ItemsProvider="foodRecallProvider" Virtualize="true" ItemSize="46" GenerateHeader="GenerateHeaderOption.Sticky" TGridItem="FoodRecall" >
<FluentDataGrid Loading="@(numResults == 0)" ItemsProvider="foodRecallProvider" OnRowDoubleClick="@(()=>DemoLogger.WriteLine("Row double clicked!"))" Virtualize="true" ItemSize="46" GenerateHeader="GenerateHeaderOption.Sticky" TGridItem="FoodRecall" >
<PropertyColumn Title="ID" Property="@(c => c!.Event_Id)" />
<PropertyColumn Property="@(c => c!.State)" Style="color: #af5f00 ;" />
<PropertyColumn Property="@(c => c!.City)" />
Expand Down
18 changes: 13 additions & 5 deletions examples/Demo/Shared/Pages/DataGrid/Examples/DataGridTypical.razor
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
@inject DataSource Data

@inject DataSource Data

<p>To test set ResizeType on the DataGrid to either DataGridResizeType.Discrete or DataGridResizeType.Exact</p>
<p>Remove the parameter completely to get the original behavior</p>

<FluentDataGrid Items="@FilteredItems" ResizableColumns=true ResizeType="DataGridResizeType.Discrete" Pagination="@pagination" GridTemplateColumns="0.2fr 1fr 0.2fr 0.2fr 0.2fr 0.2fr" RowClass="@rowClass" RowStyle="@rowStyle" Style="height: 405px;overflow:auto;">
<FluentDataGrid Items="@FilteredItems"
ResizableColumns=true
ResizeType="DataGridResizeType.Discrete"
Pagination="@pagination"
GridTemplateColumns="0.2fr 1fr 0.2fr 0.2fr 0.2fr 0.2fr"
RowClass="@rowClass"
RowStyle="@rowStyle"
Style="height: 405px;overflow:auto;">
<TemplateColumn Tooltip="true" TooltipText="@(c => "Flag of " + c.Name)" Title="Rank" SortBy="@rankSort" Align="Align.Center" InitialSortDirection="SortDirection.Ascending" IsDefaultSortColumn=true>
<img class="flag" src="_content/FluentUI.Demo.Shared/flags/@(context.Code).svg" alt="Flag of @(context.Code)" />
</TemplateColumn>
Expand All @@ -17,7 +25,7 @@
<PropertyColumn Property="@(c => c.Medals.Gold)" Sortable="true" Align="Align.Start" Tooltip="true" TooltipText="@(c => "That is " + c.Medals.Gold + " x GOLD!!")" />
<PropertyColumn Property="@(c => c.Medals.Silver)" Sortable="true" Align="Align.Center" Tooltip="true" />
<PropertyColumn Property="@(c => c.Medals.Bronze)" Sortable="true" Align="Align.End" />
<PropertyColumn Property="@(c => c.Medals.Total)" Filtered="@(minMedals != 0 || maxMedals != 120)" Align="Align.End" Tooltip="true">
<PropertyColumn Property="@(c => c.Medals.Total)" Filtered="@(minMedals != 0 || maxMedals != 130)" Align="Align.End" Tooltip="true">
<ColumnOptions>
<div style="width: 100%; height: 150px;">
<FluentSlider Label="@($"Min ({minMedals})")" Min="0" Max="150" Step="1" Orientation="Orientation.Horizontal" @bind-Value=minMedals Immediate="true" Style="width: 100%;">
Expand Down Expand Up @@ -53,15 +61,15 @@
PaginationState pagination = new PaginationState { ItemsPerPage = 10 };
string nameFilter = string.Empty;
int minMedals;
int maxMedals = 120;
int maxMedals = 130;

GridSort<Country> rankSort = GridSort<Country>
.ByDescending(x => x.Medals.Gold)
.ThenDescending(x => x.Medals.Silver)
.ThenDescending(x => x.Medals.Bronze);

Func<Country, string?> rowClass = x => x.Name.StartsWith("A") ? "highlighted-row" : null;
Func<Country, string?> rowStyle = x => x.Name.StartsWith("Au") ? "background-color: var(--highlight-bg);" : null;
Func<Country, string?> rowStyle = x => x.Name.StartsWith("Au") ? "background-color: var(--highlight-bg)" : null;

//IQueryable<Country>? FilteredItems => items?.Where(x => x.Name.Contains(nameFilter, StringComparison.CurrentCultureIgnoreCase));
Expand Down
Loading

0 comments on commit 8496705

Please sign in to comment.