Change Grid height dynamically based on number of rows it displays

Hi team,


I have user story where the user needs to print the contents of the whole page. In this page I have a grid which displays data returned by the backend. If there are more number of rows returned by the grid then the vertical scroll bar gets displayed as expected. Now when the user hits on the print button on the page as shown below I need to print all the controls with its contents. Is there a way to print all the rows of the grid when the document is printed? Do we need to dynamically change the height of the grid based on the rows returned by the backend?




Attachment: KittingForm_5607747f.zip

3 Replies 1 reply marked as answer

MS Monisha Saravanan Syncfusion Team April 19, 2022 03:05 PM UTC

Hi Baba,


Greetings from Syncfusion support.


Query: “ Now when the user hits on the print button on the page as shown below I need to print all the controls with its contents. Is there a way to print all the rows of the grid when the document is printed?”


We suspect that you need to print all the rows in the DataGrid when using print. We suggest you to use Grid height as 100%  then the grid height will adjust based on the number of rows generated or if the grid height is not set then the Grid will render based on the number of rows.


Kindly get back to us if you have further queries.


Regards,

Monisha


Marked as answer

BG Baba Goud Gadiga replied to Monisha Saravanan April 20, 2022 11:00 AM UTC

Hello Monisha,

It is working as expected after I changed the grid height to 100%. Thank you for looking into my query.


Thanks

Baba



MS Monisha Saravanan Syncfusion Team April 21, 2022 04:12 AM UTC

Hi Baba,


Thanks for the update.


We are glad to hear that your query has been resolved. Please get back to us if you need further assistance.


Regards,

Monisha


Loader.
Up arrow icon