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.

printing covered cells

Thread ID:





21477 Nov 11,2004 08:37 AM Nov 12,2004 05:29 AM Windows Forms 6
Tags: GridControl
Tyler Kohn
Asked On November 11, 2004 08:37 AM

I have a gridDataBoundGrid and when I format my grid I''m adding a covered range for a particular row: grid.Model.CoveredRanges.Add(GridRangeInfo.Cells(i,grid.Binder.NameToColIndex("Id"),i,grid.Model.ColCount)); where "i" is the index of a specific row. I''m also setting the style.BackColor to black for the first cell in the range. Visibly everything works/looks fine, the entire row is covered and black (and I can scroll and it looks fine), but when I attempt to print the grid (using the gridFitToPrint example as a guide), the row only prints black for the area visible on the screen before I attempt to print. The rest of the row is white. Everthing else is printing correctly. Thanks for any help you can provide. -Tyler

Administrator [Syncfusion]
Replied On November 11, 2004 10:17 AM

>>I''''m also setting the style.BackColor to black for the first cell in the range. How are you doing this? You cannot set the style of a particular cell in a GridDataBoundGrid, so you would have to use PrepareViewStyleInfo to try to handle this as described in this KB. Is this what you are doing? http://www.syncfusion.com/Support/article.aspx?id=560

Tyler Kohn
Replied On November 11, 2004 10:48 AM

yea, that''s what I''m doing, in the mygrid_PrepareViewStyleInfo method I''m setting the style. So if the cell is in the row I''m concerned with it sets the backcolor.

Administrator [Syncfusion]
Replied On November 11, 2004 11:39 AM

I kludged up that sample to work with a griddataboundgrid, it seems to be coloring the whole covered cell for me. Can you modify it to show the problem? CS_9977.zip

Tyler Kohn
Replied On November 11, 2004 12:17 PM

Ok, managed to do it. It turns out that if I hide the first column and span the covered range from the first (now hidden) column to the end the columns you can see this occur. I understand that you might not want to include a hidden cell in a covered range (not sure what other issues might appear). But do you know why this result occurs? Also, I noticed that if you scroll to the far right of the grid and do a print/print preview it only prints what is now currently visible. this occurs independantly of the first issue. Why is this and is how can be sure that the entire grid is printed? -tyler CS_8629.zip

Administrator [Syncfusion]
Replied On November 11, 2004 05:47 PM

I think probably the problem is that it is the top-left cell of teh covered range that is hidden. The grid takes its queues for drawing the covered range from the top-left cell. When that cell is hidden, it is never drawn which I think is what is cusing this problem. You should try adjusting your covered ranges so the top-left cell is not hidden. As far as the scrolling problem, the DrawGrid draws as much of the visible grid as will fit in the bounds. It does not necessary start at column 1. It stars with the first visible column. So, you should set LeftColIndex to make sure the part of the grid that you want draw is drawn in DrawGrid. his.gridControl1.GridBounds = new Rectangle(0, 0, gridWidth, gridHeight); this.gridControl1.LeftColIndex = 1; this.gridControl1.DrawGrid(g); this.gridControl1.ResetGridBounds();

Tyler Kohn
Replied On November 12, 2004 05:29 AM

thanks, I made both changes and it looks good.


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.