We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Freeze Row2

Thread ID:

Created:

Updated:

Platform:

Replies:

38811 Dec 19,2005 07:23 PM Jan 10,2006 07:48 AM Windows Forms 11
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On December 19, 2005 07:23 PM

HI, I tried a bunch of stuff, but nothing''s working, so.. I build a virtual grid which then I print, Row 0 is hidden, Row1 is a large header, Row 2 is my grid header. During print, I want row2(only and not row 0-1) to repeat on every page. I tried this.Model.Rows.FreezeRange(2,2), but for some reason it takes up the space of row1! pls advise.

stanleyj [Syncfusion]
Replied On December 20, 2005 08:20 AM

Hi Monica, Here is a sample that I think does what you are trying to do. http://www.syncfusion.com/Support/user/uploads/Forum_38811_b8f46f20.zip Best regards, Stanley

Administrator [Syncfusion]
Replied On December 20, 2005 02:34 PM

Not sure which part you meant would work for me. I tried: this.gridControl1.Model.Rows.HeaderCount = 2; this.gridControl1.Model.Rows.FrozenCount = 2; However, this prints Row1 along with Row2 on all the pages. I want only Row2 to be on all pages. Not Row1 and not row0 (which is hidden BTW)

stanleyj [Syncfusion]
Replied On December 21, 2005 01:03 AM

Hi Monica, The hidden rows are not printed, therefore Row 0 is never printed. I also hide Row 1 before printing and unhide the same row after printing. Was that not working for you? this.gridControl1.Model.Rows.Hidden[1] = true; // // // this.gridControl1.Model.Rows.Hidden[1] = false; You also need to freeze the rows so that it stays on all pages. If the sample is not similar to your implementation, please modify the sample. So that I will be able to suggest some solutions. Best regards, Stanley

Administrator [Syncfusion]
Replied On December 21, 2005 04:20 PM

Look for //FIXIT 1st page I want to show row1 and row2 2nd page onwards, I only want to show row2, not row1.

10.zip

stanleyj [Syncfusion]
Replied On December 22, 2005 12:56 AM

Hi Monica, You also need to freeze the rows so that row2 stays on all pages after hiding row1. private int m_pagenum = 0; private void pd_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { m_pagenum++; if(m_pagenum > 1) { gridControl1.Model.Rows.Hidden[1] = true; this.gridControl1.Model.Rows.FrozenCount = 2; } } Best regards, Stanley

Administrator [Syncfusion]
Replied On December 22, 2005 02:29 PM

thanks. That works!

Administrator [Syncfusion]
Replied On December 27, 2005 03:36 PM

I found another problem: Now the grid header (row2) prints on all the print pages, excpet what is happening is your print code is not taking the grid header''s height into consideration when it is trying to fit the rows in the page, hence the last row on the page is getting cutoff. How can I fix this so the last row does not get cut off. If I don''t make the row2 frozen, then the rows print perfectly fitted.

Administrator [Syncfusion]
Replied On December 27, 2005 05:46 PM

One more: When printing from the preview window (print icon in toolbar), it does not print Row1 in the above sample. Works fine when printing directly from File->Print. Bug?

Administrator [Syncfusion]
Replied On December 28, 2005 06:00 AM

Hi Monica, I was not able to find the last row on the page being cutoff. Can you find the issue in the attached sample? And to display Row1 in the first page while printing from PrintPreviewDialog you must handle the BeginPrint and reset the grid to the normal position. Here is a sample. Regards, Calvin.

38811.zip

Administrator [Syncfusion]
Replied On January 9, 2006 08:59 PM

Here is the sample with the problem.. Note that from 2nd page on the height of 500 (which is the height os Row1) does not get filled. On page 2, row5 should follow row4 instead of going to page3!

20.zip

Administrator [Syncfusion]
Replied On January 10, 2006 07:48 AM

Hi Monica, To take the header height into consideration you have to pass the GridResizeToFitOptions.IncludeHeaders option to the RowHeights.ResizeToFit. And to avoid the header(Row1) height from being unused, we have to hide the Row1 first then, we have to set the FrozenCount. Here is a modified sample which, resets the FrozenCount to 0 before printing the page in the BeginPrint event handler. Regards, Calvin.

38811Modi.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;