Skip to content

Commit 1ce67eb

Browse files
committed
Updates
1 parent e002f9f commit 1ce67eb

File tree

6 files changed

+36
-36
lines changed

6 files changed

+36
-36
lines changed

aspnetcore/blazor/components/prerender.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Prerendering guidance is organized in the Blazor documentation by subject matter
166166
* [Stateful reconnection after prerendering](xref:blazor/components/lifecycle#stateful-reconnection-after-prerendering)
167167
* [Prerendering with JavaScript interop](xref:blazor/components/lifecycle#prerendering-with-javascript-interop): This section also appears in the two JS interop articles on calling JavaScript from .NET and calling .NET from JavaScript.
168168
* [Handle incomplete asynchronous actions at render](xref:blazor/components/lifecycle#handle-incomplete-asynchronous-actions-at-render): Guidance for delayed rendering due to long-running lifecycle tasks during prerendering on the server.
169-
* [QuickGrid component sample app](xref:blazor/components/quickgrid#sample-app): The [**QuickGrid for Blazor** sample app](https://aspnet.github.io/quickgridsamples/) is hosted on GitHub Pages. The site loads fast thanks to static prerendering using the community-maintained [`BlazorWasmPrerendering.Build` GitHub project](https://github.com/jsakamoto/BlazorWasmPreRendering.Build).
169+
* [`QuickGrid` component sample app](xref:blazor/components/quickgrid#sample-app): The [**QuickGrid for Blazor** sample app](https://aspnet.github.io/quickgridsamples/) is hosted on GitHub Pages. The site loads fast thanks to static prerendering using the community-maintained [`BlazorWasmPrerendering.Build` GitHub project](https://github.com/jsakamoto/BlazorWasmPreRendering.Build).
170170
* [Prerendering when integrating components into Razor Pages and MVC apps](xref:blazor/components/integration)
171171

172172
* Authentication and authorization

aspnetcore/blazor/components/quickgrid.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
title: ASP.NET Core Blazor QuickGrid component
2+
title: ASP.NET Core Blazor `QuickGrid` component
33
author: guardrex
4-
description: The QuickGrid component is a Razor component for quickly and efficiently displaying data in tabular form.
4+
description: The `QuickGrid` component is a Razor component for quickly and efficiently displaying data in tabular form.
55
monikerRange: '>= aspnetcore-8.0'
66
ms.author: riande
77
ms.custom: mvc
88
ms.date: 11/12/2024
99
uid: blazor/components/quickgrid
1010
---
11-
# ASP.NET Core Blazor QuickGrid component
11+
# ASP.NET Core Blazor `QuickGrid` component
1212

1313
[!INCLUDE[](~/includes/not-latest-version-without-not-supported-content.md)]
1414

@@ -26,11 +26,11 @@ For various QuickGrid demonstrations, see the [**QuickGrid for Blazor** sample a
2626

2727
## QuickGrid implementation
2828

29-
To implement a QuickGrid component:
29+
To implement a `QuickGrid` component:
3030

3131
:::moniker range=">= aspnetcore-9.0"
3232

33-
* Specify tags for the QuickGrid component in Razor markup (`<QuickGrid>...</QuickGrid>`).
33+
* Specify tags for the `QuickGrid` component in Razor markup (`<QuickGrid>...</QuickGrid>`).
3434
* Name a queryable source of data for the grid. Use ***either*** of the following data sources:
3535
* <xref:Microsoft.AspNetCore.Components.QuickGrid.QuickGrid%601.Items%2A>: A nullable `IQueryable<TGridItem>`, where `TGridItem` is the type of data represented by each row in the grid.
3636
* <xref:Microsoft.AspNetCore.Components.QuickGrid.QuickGrid%601.ItemsProvider%2A>: A callback that supplies data for the grid.
@@ -55,7 +55,7 @@ To implement a QuickGrid component:
5555

5656
:::moniker range="< aspnetcore-9.0"
5757

58-
* Specify tags for the QuickGrid component in Razor markup (`<QuickGrid>...</QuickGrid>`).
58+
* Specify tags for the `QuickGrid` component in Razor markup (`<QuickGrid>...</QuickGrid>`).
5959
* Name a queryable source of data for the grid. Use ***either*** of the following data sources:
6060
* <xref:Microsoft.AspNetCore.Components.QuickGrid.QuickGrid%601.Items%2A>: A nullable `IQueryable<TGridItem>`, where `TGridItem` is the type of data represented by each row in the grid.
6161
* <xref:Microsoft.AspNetCore.Components.QuickGrid.QuickGrid%601.ItemsProvider%2A>: A callback that supplies data for the grid.
@@ -79,7 +79,7 @@ To implement a QuickGrid component:
7979

8080
For example, add the following component to render a grid.
8181

82-
For Blazor Web Apps, the QuickGrid component must adopt an [interactive render mode](xref:blazor/components/render-modes#render-modes) to enable interactive features, such as paging and sorting.
82+
For Blazor Web Apps, the `QuickGrid` component must adopt an [interactive render mode](xref:blazor/components/render-modes#render-modes) to enable interactive features, such as paging and sorting.
8383

8484
`PromotionGrid.razor`:
8585

@@ -101,7 +101,7 @@ There aren't current plans to extend QuickGrid with features that full-blown com
101101

102102
## Sort by column
103103

104-
The QuickGrid component can sort items by columns. In Blazor Web Apps, sorting requires the component to adopt an [interactive render mode](xref:blazor/components/render-modes#render-modes).
104+
The `QuickGrid` component can sort items by columns. In Blazor Web Apps, sorting requires the component to adopt an [interactive render mode](xref:blazor/components/render-modes#render-modes).
105105

106106
Add `Sortable="true"` (<xref:Microsoft.AspNetCore.Components.QuickGrid.ColumnBase%601.Sortable%2A>) to the <xref:Microsoft.AspNetCore.Components.QuickGrid.PropertyColumn%602> tag:
107107

@@ -113,15 +113,15 @@ In the running app, sort the QuickGrid column by selecting the rendered column t
113113

114114
## Page items with a `Paginator` component
115115

116-
The QuickGrid component can page data from the data source. In Blazor Web Apps, paging requires the component to adopt an [interactive render mode](xref:blazor/components/render-modes#render-modes).
116+
The `QuickGrid` component can page data from the data source. In Blazor Web Apps, paging requires the component to adopt an [interactive render mode](xref:blazor/components/render-modes#render-modes).
117117

118118
Add a <xref:Microsoft.AspNetCore.Components.QuickGrid.PaginationState> instance to the component's `@code` block. Set the <xref:Microsoft.AspNetCore.Components.QuickGrid.PaginationState.ItemsPerPage%2A> to the number of items to display per page. In the following example, the instance is named `pagination`, and ten items per page is set:
119119

120120
```csharp
121121
PaginationState pagination = new PaginationState { ItemsPerPage = 10 };
122122
```
123123

124-
Set the QuickGrid component's <xref:Microsoft.AspNetCore.Components.QuickGrid.QuickGrid`1.Pagination> property to `pagination`:
124+
Set the `QuickGrid` component's <xref:Microsoft.AspNetCore.Components.QuickGrid.QuickGrid`1.Pagination> property to `pagination`:
125125

126126
```razor
127127
<QuickGrid Items="..." Pagination="pagination">
@@ -130,7 +130,7 @@ Set the QuickGrid component's <xref:Microsoft.AspNetCore.Components.QuickGrid.Qu
130130
<!-- UPDATE 10.0 Tracked by https://github.com/dotnet/aspnetcore/issues/57289
131131
for multiple paginator components problem. -->
132132

133-
To provide a UI for pagination, add a [`Paginator` component](xref:Microsoft.AspNetCore.Components.QuickGrid.Paginator) above or below the QuickGrid component. Set the <xref:Microsoft.AspNetCore.Components.QuickGrid.Paginator.State%2A?displayProperty=nameWithType> to `pagination`:
133+
To provide a UI for pagination, add a [`Paginator` component](xref:Microsoft.AspNetCore.Components.QuickGrid.Paginator) above or below the `QuickGrid` component. Set the <xref:Microsoft.AspNetCore.Components.QuickGrid.Paginator.State%2A?displayProperty=nameWithType> to `pagination`:
134134

135135
```razor
136136
<Paginator State="pagination" />
@@ -142,9 +142,9 @@ QuickGrid renders additional empty rows to fill in the final page of data when u
142142

143143
## Apply row styles
144144

145-
Apply styles to rows using [CSS isolation](xref:blazor/components/css-isolation), which can include styling empty rows for QuickGrid components that [page data with a `Paginator` component](#page-items-with-a-paginator-component).
145+
Apply styles to rows using [CSS isolation](xref:blazor/components/css-isolation), which can include styling empty rows for `QuickGrid` components that [page data with a `Paginator` component](#page-items-with-a-paginator-component).
146146

147-
Wrap the QuickGrid component in a wrapper block element, for example a `<div>`:
147+
Wrap the `QuickGrid` component in a wrapper block element, for example a `<div>`:
148148

149149
```diff
150150
+ <div>
@@ -221,9 +221,9 @@ In the following example:
221221

222222
## Entity Framework Core (EF Core) data source
223223

224-
Use the factory pattern to resolve an EF Core database context that provides data to a QuickGrid component. For more information on why the factory pattern is recommended, see <xref:blazor/blazor-ef-core>.
224+
Use the factory pattern to resolve an EF Core database context that provides data to a `QuickGrid` component. For more information on why the factory pattern is recommended, see <xref:blazor/blazor-ef-core>.
225225

226-
A database context factory (<xref:Microsoft.EntityFrameworkCore.IDbContextFactory%601>) is injected into the component with the `@inject` directive. The factory approach requires disposal of the database context, so the component implements the <xref:System.IAsyncDisposable> interface with the `@implements` directive. The item provider for the QuickGrid component is a `DbSet<T>` obtained from the created database context (<xref:Microsoft.EntityFrameworkCore.IDbContextFactory%601.CreateDbContext%2A>) of the injected database context factory.
226+
A database context factory (<xref:Microsoft.EntityFrameworkCore.IDbContextFactory%601>) is injected into the component with the `@inject` directive. The factory approach requires disposal of the database context, so the component implements the <xref:System.IAsyncDisposable> interface with the `@implements` directive. The item provider for the `QuickGrid` component is a `DbSet<T>` obtained from the created database context (<xref:Microsoft.EntityFrameworkCore.IDbContextFactory%601.CreateDbContext%2A>) of the injected database context factory.
227227

228228
QuickGrid recognizes EF-supplied <xref:System.Linq.IQueryable> instances and knows how to resolve queries asynchronously for efficiency.
229229

@@ -237,7 +237,7 @@ Call <xref:Microsoft.Extensions.DependencyInjection.EntityFrameworkAdapterServic
237237
builder.Services.AddQuickGridEntityFrameworkAdapter();
238238
```
239239

240-
The following example uses an `ExampleTable` <xref:Microsoft.EntityFrameworkCore.DbSet%601> (table) from a `AppDbContext` database context (`context`) as the data source for a QuickGrid component:
240+
The following example uses an `ExampleTable` <xref:Microsoft.EntityFrameworkCore.DbSet%601> (table) from a `AppDbContext` database context (`context`) as the data source for a `QuickGrid` component:
241241

242242
```razor
243243
@using Microsoft.AspNetCore.Components.QuickGrid
@@ -325,7 +325,7 @@ However, managing column titles (names) from bound model properties is usually a
325325
public DateTime ReleaseDate { get; set; }
326326
```
327327

328-
To enable the QuickGrid component to use the <xref:System.ComponentModel.DataAnnotations.DisplayAttribute.Name?displayProperty=nameWithType> property, subclass <xref:Microsoft.AspNetCore.Components.QuickGrid.PropertyColumn`2>, either in the component or in a separate class. Call the <xref:System.ComponentModel.DataAnnotations.DisplayAttribute.GetName%2A> method to return the localized <xref:System.ComponentModel.DataAnnotations.DisplayAttribute.Name?displayProperty=nameWithType> value if an unlocalized <xref:System.ComponentModel.DisplayNameAttribute.DisplayName> ([`[DisplayName]` attribute](xref:System.ComponentModel.DisplayNameAttribute)) doesn't hold the value:
328+
To enable the `QuickGrid` component to use the <xref:System.ComponentModel.DataAnnotations.DisplayAttribute.Name?displayProperty=nameWithType> property, subclass <xref:Microsoft.AspNetCore.Components.QuickGrid.PropertyColumn`2>, either in the component or in a separate class. Call the <xref:System.ComponentModel.DataAnnotations.DisplayAttribute.GetName%2A> method to return the localized <xref:System.ComponentModel.DataAnnotations.DisplayAttribute.Name?displayProperty=nameWithType> value if an unlocalized <xref:System.ComponentModel.DisplayNameAttribute.DisplayName> ([`[DisplayName]` attribute](xref:System.ComponentModel.DisplayNameAttribute)) doesn't hold the value:
329329

330330
```csharp
331331
public class DisplayNameColumn<TGridItem, TProp> : PropertyColumn<TGridItem, TProp>
@@ -346,7 +346,7 @@ public class DisplayNameColumn<TGridItem, TProp> : PropertyColumn<TGridItem, TPr
346346
}
347347
```
348348

349-
Use the subclass in the QuickGrid component. In the following example, the preceding `DisplayNameColumn` is used. The name "`Release Date`" is provided by the [`[Display]` attribute](xref:System.ComponentModel.DataAnnotations.DisplayAttribute) in the model, so there's no need to specify a <xref:Microsoft.AspNetCore.Components.QuickGrid.ColumnBase%601.Title>:
349+
Use the subclass in the `QuickGrid` component. In the following example, the preceding `DisplayNameColumn` is used. The name "`Release Date`" is provided by the [`[Display]` attribute](xref:System.ComponentModel.DataAnnotations.DisplayAttribute) in the model, so there's no need to specify a <xref:Microsoft.AspNetCore.Components.QuickGrid.ColumnBase%601.Title>:
350350

351351
```razor
352352
<DisplayNameColumn Property="movie => movie.ReleaseDate" />
@@ -434,7 +434,7 @@ The QuickGrid scaffolder scaffolds Razor components with QuickGrid to display da
434434

435435
The scaffolder generates basic Create, Read, Update, and Delete (CRUD) pages based on an Entity Framework Core data model. You can scaffold individual pages or all of the CRUD pages. You select the model class and the `DbContext`, optionally creating a new `DbContext` if needed.
436436

437-
The scaffolded Razor components are added to the project's in a generated folder named after the model class. The generated `Index` component uses a QuickGrid component to display the data. Customize the generated components as needed and enable interactivity to take advantage of interactive features, such as [paging](#page-items-with-a-paginator-component), [sorting](#sort-by-column) and filtering.
437+
The scaffolded Razor components are added to the project's in a generated folder named after the model class. The generated `Index` component uses a `QuickGrid` component to display the data. Customize the generated components as needed and enable interactivity to take advantage of interactive features, such as [paging](#page-items-with-a-paginator-component), [sorting](#sort-by-column) and filtering.
438438

439439
The components produced by the scaffolder require server-side rendering (SSR), so they aren't supported when running on WebAssembly.
440440

aspnetcore/blazor/tutorials/movie-database-app/part-2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ The component files in the `MoviePages` folder are described in greater detail i
289289

290290
ASP.NET Core is built with dependency injection, which is a software design pattern for achieving [Inversion of Control (IoC)](/dotnet/standard/modern-web-apps-azure-architecture/architectural-principles#dependency-inversion) between classes and their dependencies. Services, such as the EF Core database context, are registered with dependency injection during application startup. These services are injected into Razor components for use by the components.
291291

292-
The [QuickGrid](xref:Microsoft.AspNetCore.Components.QuickGrid) component is a Razor component for efficiently displaying data in tabular form. The scaffolder places a QuickGrid component in the `Index` component (`Components/Pages/Index.razor`) to display movie entities. Calling <xref:Microsoft.Extensions.DependencyInjection.EntityFrameworkAdapterServiceCollectionExtensions.AddQuickGridEntityFrameworkAdapter%2A> on the service collection adds an EF Core adapter for QuickGrid to recognize EF Core-supplied <xref:System.Linq.IQueryable%601> instances and to resolve database queries asynchronously for efficiency.
292+
The [QuickGrid](xref:Microsoft.AspNetCore.Components.QuickGrid) component is a Razor component for efficiently displaying data in tabular form. The scaffolder places a `QuickGrid` component in the `Index` component (`Components/Pages/Index.razor`) to display movie entities. Calling <xref:Microsoft.Extensions.DependencyInjection.EntityFrameworkAdapterServiceCollectionExtensions.AddQuickGridEntityFrameworkAdapter%2A> on the service collection adds an EF Core adapter for QuickGrid to recognize EF Core-supplied <xref:System.Linq.IQueryable%601> instances and to resolve database queries asynchronously for efficiency.
293293

294294
In combination with <xref:Microsoft.AspNetCore.Builder.DeveloperExceptionPageExtensions.UseDeveloperExceptionPage%2A>, <xref:Microsoft.Extensions.DependencyInjection.DatabaseDeveloperPageExceptionFilterServiceExtensions.AddDatabaseDeveloperPageExceptionFilter%2A> captures database-related exceptions that can be resolved by using Entity Framework migrations. When these exceptions occur, an HTML response is generated with details about possible actions to resolve the issue.
295295

aspnetcore/blazor/tutorials/movie-database-app/part-6.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This article is the sixth part of the Blazor movie database app tutorial that te
1717

1818
This part of the tutorial series covers adding a search feature to the movies `Index` component to filter movies by title.
1919

20-
## Implement a filter feature for the QuickGrid component
20+
## Implement a filter feature for the `QuickGrid` component
2121

2222
The [QuickGrid](xref:Microsoft.AspNetCore.Components.QuickGrid) component is used by the movie `Index` component (`Components/MoviePages/Index.razor`) to display movies from the database:
2323

@@ -29,7 +29,7 @@ The [QuickGrid](xref:Microsoft.AspNetCore.Components.QuickGrid) component is use
2929

3030
The <xref:Microsoft.AspNetCore.Components.QuickGrid.QuickGrid%601.Items%2A> parameter receives an `IQueryable<TGridItem>`, where `TGridItem` is the type of data represented by each row in the grid (`Movie`). <xref:Microsoft.AspNetCore.Components.QuickGrid.QuickGrid%601.Items%2A> is assigned a collection of movie entities (`DbSet<Movie>`) obtained from the created database context (<xref:Microsoft.EntityFrameworkCore.IDbContextFactory%601.CreateDbContext%2A>) of the injected database context factory (`DbFactory`).
3131

32-
To make the QuickGrid component filter on the movie title, the `Index` component should:
32+
To make the `QuickGrid` component filter on the movie title, the `Index` component should:
3333

3434
* Set a filter string as a *component parameter* from the query string.
3535
* If the parameter has a value, filter the movies returned from the database.
@@ -49,7 +49,7 @@ private IQueryable<Movie> FilteredMovies =>
4949

5050
The `FilteredMovies` property is an `IQueryable<Movie>`, which is the type for assignment to the QuickGrid's <xref:Microsoft.AspNetCore.Components.QuickGrid.QuickGrid%601.Items%2A> parameter. The property filters the list of movies based on the supplied `TitleFilter`. If a `TitleFilter` isn't assigned a value from the query string (`TitleFilter` is `null`), an empty string (`string.Empty`) is used for the <xref:System.String.Contains%2A> clause. Therefore, no movies are filtered for display.
5151

52-
Change the QuickGrid component's <xref:Microsoft.AspNetCore.Components.QuickGrid.QuickGrid%601.Items%2A> parameter to use the `movies` collection:
52+
Change the `QuickGrid` component's <xref:Microsoft.AspNetCore.Components.QuickGrid.QuickGrid%601.Items%2A> parameter to use the `movies` collection:
5353

5454
```diff
5555
- <QuickGrid Class="table" Items="context.Movie">

aspnetcore/blazor/tutorials/movie-database-app/part-7.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Add the following `<div>` block between the `<div>` block for `Price` and the sa
8080

8181
Open the `Index` component definition file (`Components/Pages/MoviePages/Index.razor`).
8282

83-
Update the QuickGrid component to include the movie rating. Add the following <xref:Microsoft.AspNetCore.Components.QuickGrid.PropertyColumn`2> immediately after the column for `Price`:
83+
Update the `QuickGrid` component to include the movie rating. Add the following <xref:Microsoft.AspNetCore.Components.QuickGrid.PropertyColumn`2> immediately after the column for `Price`:
8484

8585
```razor
8686
<PropertyColumn Property="movie => movie.Rating" />

0 commit comments

Comments
 (0)