Data Grid: How to calculate max ItemsPerpage? #3122
-
I would like my DataGrid to occupy full height and calculate in maximum number of rows to assign to Itemsperpage of Pagination. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
I don't think that is possible to do. How would you handle different screen resolutions? |
Beta Was this translation helpful? Give feedback.
-
@vnbaaij @dvoituron I also needed the ability to automatically calculate the Runs against the demo data and tested with several devices in dev tools and they behaved. Also browser zooming recalculates correctly as well as resizing the browser window.
|
Beta Was this translation helpful? Give feedback.
Thanks for the feedback. Some parent elements of the component needed
height
specified inIssueTest.razor
(demo-section-content
,fluent-tabs
,fluent-tab-panel
anddemo-section-example
) so I added them to the styles section of this sample.Noticed that the
resize
event didn't handle browser restore/maximize actions so switched toResizeObserver
.Added
visualViewport.height
detection for better accuracy on mobile browsers.Maybe the datagrid should snap to size when hitting a smaller break point if possible. It appears as though it's animating to size but I'm thinking there might be a lot of layout recalculations happening. A debounce would fix it but not ideal.