You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/blazor/components/quickgrid.md
+57Lines changed: 57 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,6 +138,63 @@ To provide a UI for pagination, add a [`Paginator` component](xref:Microsoft.Asp
138
138
139
139
In the running app, page through the items using a rendered `Paginator` component.
140
140
141
+
QuickGrid renders additional empty rows to fill in the final page of data when used with a `Paginator` component. In .NET 9 or later, empty data cells (`<td></td>`) are added to the empty rows. The empty rows are intended to facilitate rendering the QuickGrid with stable row height and styling across all pages. You can apply styles to the rows using [CSS isolation](xref:blazor/components/css-isolation) by wrapping the `QuickGrid` component in a wrapper element, such as a `<div>`, and applying a row style with `::deep`[pseudo-elements](https://developer.mozilla.org/docs/Web/CSS/Pseudo-elements):
142
+
143
+
```css
144
+
::deep tr {
145
+
height: 2em;
146
+
}
147
+
```
148
+
149
+
:::moniker range=">= aspnetcore-9.0"
150
+
151
+
<!-- UPDATE 10.0 Check on https://github.com/dotnet/aspnetcore/issues/59078 to see
152
+
if an empty row template feature is added that will result in an
153
+
update the following content for >=10.0. -->
154
+
155
+
In .NET 9 or later, Bootstrap styling adds a bottom border to empty row data cells, which results in a UI artifact. To remove the border styling of the empty cells on these rows, use [CSS isolation](xref:blazor/components/css-isolation).
156
+
157
+
Consider the following QuickGrid placed in the app's `Index` component. The `QuickGrid` component has a wrapper `<div>` element, which permits you to apply `::deep`[pseudo-elements](https://developer.mozilla.org/docs/Web/CSS/Pseudo-elements) to the QuickGrid.
* Empty row data cells aren't displayed, which avoids empty row cell borders rendering per the Bootstrap style.
181
+
182
+
`Index.razor.css`:
183
+
184
+
```css
185
+
::deep tr:has(>td:not(:empty)) >td {
186
+
display: table-cell;
187
+
}
188
+
189
+
::deep td:empty {
190
+
display: none;
191
+
}
192
+
```
193
+
194
+
:::moniker-end
195
+
196
+
For more information on using `::deep`[pseudo-elements](https://developer.mozilla.org/docs/Web/CSS/Pseudo-elements) with CSS isolation, see <xref:blazor/components/css-isolation#child-component-support>.
197
+
141
198
## Custom attributes and styles
142
199
143
200
QuickGrid also supports passing custom attributes and style classes (<xref:Microsoft.AspNetCore.Components.QuickGrid.QuickGrid%601.Class%2A>) to the rendered table element:
0 commit comments