Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DataGrid] Alter rendering to use table elements #2664

Open
wants to merge 41 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
2e6c235
Replace grid web components with regular table elements
vnbaaij Aug 29, 2024
9cd10ac
Adjust styling
vnbaaij Sep 2, 2024
5212a8b
Resize rework
vnbaaij Sep 3, 2024
97d76c7
Merge branch 'dev' into users/vnbaaij/grid-work
vnbaaij Sep 4, 2024
f0904e5
- Rename example EventHandlers
vnbaaij Sep 4, 2024
dd494ce
- Redo AutoFit based on table-layout
vnbaaij Sep 4, 2024
c371bdd
- CSS cleanup
vnbaaij Sep 4, 2024
f8f4f0c
- Remove commented code
vnbaaij Sep 5, 2024
2c7f565
Update version
vnbaaij Sep 5, 2024
6dbfb85
- Fix verified files for DataGrid tests
vnbaaij Sep 5, 2024
cc4a77f
merge dev
vnbaaij Sep 6, 2024
41e8026
- Script optimization
vnbaaij Sep 10, 2024
c18d486
- Rename ShowSortIcon -> IsActiveSortColumn
vnbaaij Sep 12, 2024
0e1cacc
More optimizations and fixes
vnbaaij Sep 15, 2024
b995861
Merge branch 'dev' into users/vnbaaij/grid-work
vnbaaij Sep 15, 2024
13d62a3
Merge branch 'users/vnbaaij/grid-work' into users/vnbaaij/grid-work-p…
vnbaaij Sep 15, 2024
bf7c20d
- More fine-tunning.
vnbaaij Sep 16, 2024
2de45e3
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Sep 16, 2024
7ddb060
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Sep 17, 2024
3551ef6
Fix tests
vnbaaij Sep 17, 2024
c951377
- Styling updates
vnbaaij Sep 17, 2024
04c0a07
- Don't use dynamic row size for now.
vnbaaij Sep 17, 2024
36148e9
Fix tests
vnbaaij Sep 17, 2024
fb0a25d
More style updates
vnbaaij Sep 17, 2024
dfb6b7e
- Re-add separate header buttons
vnbaaij Sep 17, 2024
a254796
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Sep 18, 2024
e58feee
merge
vnbaaij Sep 18, 2024
b16868a
Fix merge issues
vnbaaij Sep 18, 2024
ea3eebf
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Sep 18, 2024
a26c1f9
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Sep 18, 2024
2001707
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Sep 24, 2024
74b00d8
merge dev
vnbaaij Sep 27, 2024
6034b0f
Fix merge error
vnbaaij Sep 27, 2024
4e1d24a
Change icons in grid to size 20 (nice in the middel of Aspire (16) an…
vnbaaij Sep 27, 2024
dab38e6
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Oct 2, 2024
13d0e11
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Oct 2, 2024
d6af544
Fix tests/verified files
vnbaaij Oct 2, 2024
5033c97
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Oct 9, 2024
05e77dd
Merge branch 'dev' into users/vnbaaij/grid-work-phase2
vnbaaij Oct 17, 2024
7060116
Fix virtualized grid row height
vnbaaij Oct 21, 2024
bca8540
Fix column resizing when in rtl mode
vnbaaij Oct 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<SolutionDir>$(MSBuildThisFileDirectory)</SolutionDir>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>

<VersionFile>4.10.3</VersionFile>
<VersionPrefix>4.10.3</VersionPrefix>
<VersionFile>4.11.0</VersionFile>
<VersionPrefix>4.11.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<AssemblyVersion>$(VersionFile)</AssemblyVersion>
<FileVersion>$(VersionFile)</FileVersion>
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ variables:
# File and Package version
# dev branch: 1.2.4-Preview-23282-1' (PackageSuffix is always ignored in Dev branch)
# main branch: 1.2.4-RC.1' (PackageSuffix is ignored, if empty, in Main branch)
FileVersion: '4.10.3' # Set the next final version here.
FileVersion: '4.11.0' # Set the next final version here.
PackageSuffix: ''
6 changes: 3 additions & 3 deletions examples/Demo/Shared/Components/ApiDocumentation.razor
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
string header = Properties.Any(x => x.IsParameter) ? "Parameters" : "Properties";
<h4 id="@(_id + "_properties")">@header</h4>
<div class="docgrid">
<FluentDataGrid Items="@this.Properties.AsQueryable()" GridTemplateColumns="1fr 1fr 0.7fr 2fr">
<FluentDataGrid Items="@this.Properties.AsQueryable()" GridTemplateColumns="1fr 1fr 0.7fr 2fr" MultiLine="true">
<TemplateColumn Title="Name"><code>@context.Name</code></TemplateColumn>
<TemplateColumn Title="Type">
@context.Type
Expand Down Expand Up @@ -82,7 +82,7 @@
{
<h4 id="@(_id)_callbacks">EventCallbacks</h4>
<div class="docgrid">
<FluentDataGrid Items="@this.Events.AsQueryable()" GridTemplateColumns="1fr 1fr 1fr">
<FluentDataGrid Items="@this.Events.AsQueryable()" GridTemplateColumns="1fr 1fr 1fr" MultiLine="true">
<TemplateColumn Title="Name"><code>@context.Name</code></TemplateColumn>
<PropertyColumn Property="@(c => c.Type)" />
<TemplateColumn Title="Description">
Expand All @@ -98,7 +98,7 @@
{
<h4 id="@(_id)_methods">Methods</h4>
<div class="docgrid">
<FluentDataGrid Items="@this.Methods.AsQueryable()" GridTemplateColumns="1fr 1fr 1fr 1fr">
<FluentDataGrid Items="@this.Methods.AsQueryable()" GridTemplateColumns="1fr 1fr 1fr 1fr" MultiLine="true">
<TemplateColumn Title="Name"><code>@context.Name</code></TemplateColumn>
<TemplateColumn Title="Parameters">
@foreach (var param in @context.Parameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1853,6 +1853,14 @@
is small or if you are using pagination.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1.OverscanCount">
<summary>
This is applicable only when using <see cref="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1.Virtualize"/>. It defines how many additional items will be rendered
before and after the visible region to reduce rendering frequency during scrolling. While higher values can improve
scroll smoothness by rendering more items off-screen, they can also increase initial load times. Finding a balance
based on your data set size and user experience requirements is recommended. The default value is 3.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1.ItemSize">
<summary>
This is applicable only when using <see cref="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1.Virtualize"/>. It defines an expected height in pixels for
Expand Down Expand Up @@ -1997,6 +2005,16 @@
Sets <see cref="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1.GridTemplateColumns"/> to automatically fit the columns to the available width as best it can.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1.RowSize">
<summary>
Gets or sets the size of each row in the grid based on the <see cref="T:Microsoft.FluentUI.AspNetCore.Components.DataGridRowSize"/> enum.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1.MultiLine">
<summary>
Gets or sets a value indicating whether the grid should allow multiple lines of text in cells.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1.SelectColumns">
<summary>
Gets the first (optional) SelectColumn
Expand Down Expand Up @@ -2157,7 +2175,7 @@
Gets or sets the owning <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1"/> component.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridCell`1.GridContext">
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridCell`1.InternalGridContext">
<summary>
Gets or sets the owning <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1"/> component
</summary>
Expand All @@ -2167,6 +2185,11 @@
Gets a reference to the column that this cell belongs to.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridCell`1.Grid">
<summary>
Gets a reference to the enclosing <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1" />.
</summary>
</member>
<member name="M:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridCell`1.HandleOnCellClickAsync">
<summary />
</member>
Expand Down Expand Up @@ -2196,11 +2219,16 @@
Gets or sets the content to be rendered inside the component.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1.Owner">
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1.InternalGridContext">
<summary>
Gets or sets the owning <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1"/> component
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1.Grid">
<summary>
Gets a reference to the enclosing <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1" />.
</summary>
</member>
<member name="M:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1.HandleOnRowClickAsync(System.String)">
<summary />
</member>
Expand Down Expand Up @@ -13383,6 +13411,32 @@
Resize datagrid columns by exact pixel values
</summary>
</member>
<member name="T:Microsoft.FluentUI.AspNetCore.Components.DataGridRowSize">
<summary>
The height of each <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1"/> in a <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1"/>.
Values are in pixels.
</summary>
</member>
<member name="F:Microsoft.FluentUI.AspNetCore.Components.DataGridRowSize.Small">
<summary>
Small row height (default)
</summary>
</member>
<member name="F:Microsoft.FluentUI.AspNetCore.Components.DataGridRowSize.Medium">
<summary>
Medium row height
</summary>
</member>
<member name="F:Microsoft.FluentUI.AspNetCore.Components.DataGridRowSize.Smaller">
<summary>
Smaller row height
</summary>
</member>
<member name="F:Microsoft.FluentUI.AspNetCore.Components.DataGridRowSize.Large">
<summary>
Large row height
</summary>
</member>
<member name="T:Microsoft.FluentUI.AspNetCore.Components.DataGridRowType">
<summary>
The type of <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1"/> in a <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1"/>.
Expand Down
2 changes: 1 addition & 1 deletion examples/Demo/Shared/Pages/DataGrid/DataGridPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ fluent-data-grid-row:has([row-selected]) {

<DemoSection Title="Multiline text content" Component="@typeof(DataGridMultilineText)">
<Description>
Example of using the <code>Class</code> parameter to style parts of the grid. Note that the class used in the example (<code>multiline-text</code>) has been added to the FluentDataGridCell css.
Set the grid parameter <code>MultiLine</code> to true when you have cells in your data that will take up more than a single line.
</Description>
</DemoSection>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<FluentGrid Spacing="4">
<FluentGridItem xs="12">
<h4>With auto-fit</h4>
<FluentDataGrid Items="@people" AutoFit="true">
<FluentDataGrid Items="@people" Style="width: 100%;" AutoFit="true">
<PropertyColumn Property="@(p => p.PersonId)" Sortable="true" />
<PropertyColumn Property="@(p => p.Name)" Sortable="true" />
<PropertyColumn Property="@(p => p.BirthDate)" Format="yyyy-MM-dd" Sortable="true" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,52 @@

}


<FluentToolbar>
<FluentRadioGroup Name="rt" @bind-Value="@_resizeType" Label="Resize type">
<FluentRadio Value="@((DataGridResizeType?)null)">None</FluentRadio>
<FluentRadio Value="@DataGridResizeType.Discrete">Discrete</FluentRadio>
<FluentRadio Value="@DataGridResizeType.Exact">Exact</FluentRadio>
</FluentRadioGroup>
<FluentSpacer Width="25"/>
<FluentCheckbox @bind-Value="@_showActionsMenu" Label="Use menu for column actions" />
<FluentRadioGroup Name="rt" @bind-Value="@_resizeType" Label="Resize type">
<FluentRadio Value="@((DataGridResizeType?)null)">None</FluentRadio>
<FluentRadio Value="@DataGridResizeType.Discrete">Discrete</FluentRadio>
<FluentRadio Value="@DataGridResizeType.Exact">Exact</FluentRadio>
</FluentRadioGroup>
<FluentSpacer Width="25" />
<FluentCheckbox @bind-Value="@_showActionsMenu" Label="Use menu for column actions" />
</FluentToolbar>
<FluentDataGrid Items="@FilteredItems"
ResizableColumns=true
ResizeType="@_resizeType"
HeaderCellAsButtonWithMenu="_showActionsMenu"
Pagination="@pagination"
TGridItem="Country"
OnRowFocus="HandleRowFocus"
GridTemplateColumns="0.2fr 1fr 0.2fr 0.2fr 0.2fr 0.2fr"
Style="height: 405px; overflow:auto;"
ShowHover="true">
<TemplateColumn Title="Rank" SortBy="@rankSort" Align="Align.Center">
<img class="flag" src="_content/FluentUI.Demo.Shared/flags/@(context.Code).svg" alt="Flag of @(context.Code)" />
</TemplateColumn>
<PropertyColumn Property="@(c => c.Name)" InitialSortDirection=SortDirection.Descending Sortable="true" IsDefaultSortColumn=true Comparer="@StringLengthComparer.Instance" Filtered="!string.IsNullOrWhiteSpace(nameFilter)">
<ColumnOptions>
<div class="search-box">
<FluentSearch type="search" Autofocus=true @bind-Value=nameFilter @oninput="HandleCountryFilter" AfterBindValue="HandleClear" Placeholder="Country name..." />
</div>
</ColumnOptions>
</PropertyColumn>
@* <TemplateColumn Title="Name" InitialSortDirection=SortDirection.Descending SortBy="@nameSort" IsDefaultSortColumn=true Filtered="!string.IsNullOrWhiteSpace(nameFilter)">
<ColumnOptions>
<div class="search-box">
<div style="height: 400px; overflow-x:auto; display:flex;">
<FluentDataGrid Items="@FilteredItems"
ResizableColumns=true
ResizeType="@_resizeType"
HeaderCellAsButtonWithMenu="_showActionsMenu"
Pagination="@pagination"
TGridItem="Country"
OnRowFocus="HandleRowFocus"
GridTemplateColumns="0.2fr 1fr 0.2fr 0.2fr 0.2fr 0.2fr"
ShowHover="true">
<TemplateColumn Title="Rank" Sortable="true" SortBy="@rankSort" Align="Align.Center">
<img class="flag" src="_content/FluentUI.Demo.Shared/flags/@(context.Code).svg" alt="Flag of @(context.Code)" />
</TemplateColumn>
<PropertyColumn Property="@(c => c.Name)" InitialSortDirection=SortDirection.Descending Sortable="true" IsDefaultSortColumn=true Comparer="@StringLengthComparer.Instance" Filtered="!string.IsNullOrWhiteSpace(nameFilter)">
<ColumnOptions>
<div class="search-box">
<FluentSearch type="search" Autofocus=true @bind-Value=nameFilter @oninput="HandleCountryFilter" @bind-Value:after="HandleClear" Placeholder="Country name..." />
</div>
</ColumnOptions>
</PropertyColumn>
@* <TemplateColumn Title="Name" InitialSortDirection=SortDirection.Descending SortBy="@nameSort" IsDefaultSortColumn=true Filtered="!string.IsNullOrWhiteSpace(nameFilter)">
<ColumnOptions>
<div class="search-box">
<FluentSearch type="search" Autofocus=true @bind-Value=nameFilter @oninput="HandleCountryFilter" @bind-Value:after="HandleClear" Placeholder="Country name..." />
</div>
</ColumnOptions>
<ChildContent>
@(context.Name)
</ChildContent>
</TemplateColumn> *@
<PropertyColumn Property="@(c => c.Medals.Gold)" Sortable="true" Align="Align.Start" />
<PropertyColumn Property="@(c => c.Medals.Silver)" Sortable="true" Align="Align.Center" />
<PropertyColumn Property="@(c => c.Medals.Bronze)" Sortable="true" Align="Align.End" />
<PropertyColumn Property="@(c => c.Medals.Total)" Sortable="true" Align="Align.End" />
</FluentDataGrid>

</div>
</ColumnOptions>
<ChildContent>
@(context.Name)
</ChildContent>
</TemplateColumn> *@
<PropertyColumn Property="@(c => c.Medals.Gold)" Sortable="true" Align="Align.Start" />
<PropertyColumn Property="@(c => c.Medals.Silver)" Sortable="true" Align="Align.Center" />
<PropertyColumn Property="@(c => c.Medals.Bronze)" Sortable="true" Align="Align.End" />
<PropertyColumn Property="@(c => c.Medals.Total)" Sortable="true" Align="Align.End" />
</FluentDataGrid>
</div>

<FluentPaginator State="@pagination">
<SummaryTemplate>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<FluentDataGrid Items="@people">
<FluentDataGrid Items="@people" MultiLine="true">
<PropertyColumn Property="@(p => p.PersonId)" Sortable="true" />
<PropertyColumn Property="@(p => p.Name)" Sortable="true" />
<PropertyColumn Property="@(p => p.Description)" Sortable="true" Class="multiline-text" />
<PropertyColumn Property="@(p => p.Description)" Sortable="true" />
</FluentDataGrid>

@code {
Expand All @@ -13,4 +13,4 @@
new Person(10944, "António Langa", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."),
new Person(11203, "Julie Smith","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."),
}.AsQueryable();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div style="height: 400px; overflow-y: scroll;">
<FluentDataGrid @ref="grid" Items=@items GridTemplateColumns="1fr 1fr 1fr 1fr" Style="height: 100%;">
<FluentDataGrid @ref="grid" Items=@items GridTemplateColumns="1fr 1fr 1fr 1fr">
<ChildContent>
<PropertyColumn Property="@(c => c.Item1)" Sortable="true" />
<PropertyColumn Property="@(c => c.Item2)" />
Expand Down Expand Up @@ -53,7 +53,7 @@
grid?.SetLoadingState(true);
items = null;

await Task.Delay(2500);
await Task.Delay(1500);

items = GenerateSampleGridData(100);
grid?.SetLoadingState(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
@inject NavigationManager NavManager

<div style="height: 434px; overflow:auto;" tabindex="-1">
<FluentDataGrid style="height: 100%;" Loading="@(numResults == null)" ItemsProvider="foodRecallProvider" OnRowDoubleClick="@(()=>DemoLogger.WriteLine("Row double clicked!"))" Virtualize="true" ItemSize="46" GenerateHeader="GenerateHeaderOption.Sticky" TGridItem="FoodRecall" >
<FluentDataGrid Style="height: 100%;"
Loading="@(numResults == null)"
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<FluentDataGrid Style="min-width: max-content;" Items="@people">
<PropertyColumn Property="@(p => p.PersonId)" Sortable="true" />
<PropertyColumn Property="@(p => p.Name)" Sortable="true" />
<PropertyColumn Property="@(p => p.Description)" Sortable="true" Class="multiline-text" />
<PropertyColumn Property="@(p => p.Description)" Sortable="true" Style="text-overflow: unset; overflow: visible;" />
</FluentDataGrid>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@inject DataSource Data

<FluentDataGrid Items="@Data.People" style="width: 600px;">
<FluentDataGrid Items="@Data.People" style="width: 600px;" RowSize="@DataGridRowSize.Medium">
<TemplateColumn Title="Person" SortBy="@sortByName">
<div class="flex items-center">
<img class="flag" src="_content/FluentUI.Demo.Shared/flags/@(context.CountryCode.ToLower()).svg" alt="Flag of @(context.CountryCode)" />
Expand Down Expand Up @@ -28,4 +28,4 @@
void Bonus(Person p) => message = $"You want to give {p.FirstName} {p.LastName} a regular bonus";

void DoubleBonus(Person p) => message = $"You want to give {p.FirstName} {p.LastName} a double bonus";
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<FluentDataGrid id="defaultGrid" Items=RowsGrid.AsQueryable() GridTemplateColumns="1fr 1fr" TGridItem=SampleGridData OnRowFocus="HandleRowFocus" OnCellFocus="HandleCellFocus">
<FluentDataGrid id="defaultGrid" Items=RowsGrid.AsQueryable() GridTemplateColumns="1fr 1fr" TGridItem=SampleGridData OnRowClick="HandleRowClick" OnCellClick="HandleCellClick">
<TemplateColumn Title="Name">
<FluentTextField @bind-Value="@context!.Name"/>
</TemplateColumn>
Expand All @@ -14,7 +14,7 @@
{
public string Name { get; set; }
public int Age { get; set; }

public SampleGridData(string name, int age)
{
Name = name;
Expand All @@ -30,12 +30,12 @@
new SampleGridData("Bob", 20 )
};

private void HandleRowFocus(FluentDataGridRow<SampleGridData> row)
private void HandleRowClick(FluentDataGridRow<SampleGridData> row)
{
DemoLogger.WriteLine($"Row focused: {row.RowIndex}");
}

private void HandleCellFocus(FluentDataGridCell<SampleGridData> cell)
private void HandleCellClick(FluentDataGridCell<SampleGridData> cell)
{
DemoLogger.WriteLine($"Cell focused: {cell.GridColumn}");
}
Expand Down
Loading
Loading