I have an sfgrid control.I have set "EnableVirtualization=true" and "height = 400".The feature of virtualization working fine when I set height in sfgrid.I would like to know how to set height in sfgrid dynamically based on screen resolution
Code:-
<SfGrid @ref="gridRef" AllowSelection="true" AllowFiltering="false" Height="400" AllowPaging="false" AllowTextWrap="true" DataSource="@materialHeaderSetups" Toolbar=@Tool EnableVirtualization=true>
<GridFilterSettings Type="Syncfusion.Blazor.Grids.FilterType.Menu"></GridFilterSettings>
<SfGrid>
Hi Kins,
Greetings from Syncfusion support.
Query: “I would like to know how to set height in sfgrid dynamically based on screen resolution ”
We have checked your query and we suspect that you need to set height to DataGrid in responsive to screen size. We have already documented an topic related to your requirement in our below UG section. By defining Grid height as 100% will make the Grid responsive to the parent container. We can calculate and set the height to the parent container. So that the Grid will behave with mentioned height in the parent div. Kindly refer the below UG for additional information.
Reference: https://blazor.syncfusion.com/documentation/datagrid/scrolling#responsive-with-parent-container
If the reported issue still persist then kindly share the below details to validate further at our end.
The above-requested details will be very helpful for us to validate the reported query at our end and provide the solution as early as possible.
Regards,
Monisha
Did you find out the solution, if so please share here as well
Hi Adnan,
Greetings from Syncfusion.
We suspect that your requirement is to render Grid in responsive to the browser layout. If so we suggest you to use the below highlighted solution at your end.
|
<div style="width:calc(100vw - 20rem); height:calc(100vh - 7rem);"> @*Change the rem values based on your browser page layout*@ <SfGrid DataSource="@Orders" Height="100%" Width="100%"> <GridColumns> .. </GridColumns> </SfGrid> </div>
|
We have documented the same in the below UG section. Kindly refer this for additional information
Reference: https://blazor.syncfusion.com/documentation/datagrid/scrolling#responsive-with-parent-container
If you still face difficulties or your requirement is different then kindly share the below details to validate further at our end.
The above-requested details will be very helpful for us to validate the reported query at our end and provide the solution as early as possible.
Regards,
Monisha