This is a migrated thread and some comments may be shown as answers.

Resizing Grid for Print Preview page.

2 Answers 114 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shantnu Chaturvedi
Top achievements
Rank 1
Shantnu Chaturvedi asked on 09 Dec 2008, 04:43 PM
Hi,

I am using the radGrid for a print preview page. Here I am using the Grid in a table in the page and the width of the Grid is a Percentage (%) of the Table/Page. This works perfectly by resizing the grid width as I resize the page.
So, it works for different screen resolutions also.

Also in the grid I am using the following option:

<

PagerStyle Mode ="NextPrevNumericAndAdvanced" AlwaysVisible="true" />

 


Now, as far as the height of the grid is concerned, when I put Pixels (px),then it works by adjusting the height statically. (Of course this messes the grid view in lower/higher resolutions).
But, when I put the height of the grid as Percentage (%) of the Table/Page, this completely collapses the grid and I cannot see anything on the Grid.

My aim is to display the data in the Grid completely on the "Print Preview" page when I resize the page.

Another option would be to allow viewing of data in grid by scrolling and allow me to print all the Grid data.
But, in the following post, it is mentioned that direct printing of the data in grid is not supported:

http://www.telerik.com/community/forums/aspnet-ajax/grid/print-grid-data.aspx

But I know that there is possibly a way to use some other function to print all the data in the grid or at least adjust the height of the grid so that the display of the Print preview page is better (which can then be printed by page print).

Thank you.
~schaturvedi

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 10 Dec 2008, 08:32 AM
Hello Shantnu,

The current CSS specification says that if an element has its height set in percent, then the element's parent must have its height set explicitly as well.

Here is an example of 100% wide/high RadGrid resizing together with the browser window:

http://www.telerik.com/community/code-library/aspnet-ajax/grid/setting-100-height-and-resize-on-container-resize-for-grid-with-scrolling-and-static-headers.aspx

In case RadGrid is ajaxified, you will also need:

http://www.telerik.com/community/code-library/aspnet-ajax/ajax/how-to-set-100-height-and-random-styles-to-a-radajaxmanager-update-panel.aspx


Regards,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Shantnu Chaturvedi
Top achievements
Rank 1
answered on 11 Dec 2008, 02:18 PM
Hi,

The function "Resize()" given in the below solution solved my problem.

http://www.telerik.com/community/code-library/aspnet-ajax/grid/setting-100-height-and-resize-on-container-resize-for-grid-with-scrolling-and-static-headers.aspx

I am now able to resixe the height of the Grid. But I did have to chnage the header DOCTYPE to "HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"  also for it to work completely.

<%

-------------------------------------------------------------------------------------------------------------------------------

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

-------------------------------------------------------------------------------------------------------------------------------

%>

 

<!

DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

Thank you,
~Shantnu

 

Tags
Grid
Asked by
Shantnu Chaturvedi
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Shantnu Chaturvedi
Top achievements
Rank 1
Share this question
or