How to dynamically adjust the size of the Grid in Blazor DataGrid based on browser window resizing?

Answer:

Define width and height of grid’s parent div element dynamically using calc. Here is the code snippet for your reference,

@*Calculate the parent div element’s height and width based on your browser page layout*@

<div style="width: calc(100vw - 14rem);height: calc(100vh - 2rem);">

<SfGrid ID="Grid" ... Width="100%" Height="100%">

...

SfGrid>

div>



Loader.
Up arrow icon