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.
Syncfusion Feedback

DrawClippedGrid painting issues

Thread ID:

Created:

Updated:

Platform:

Replies:

36689 Nov 7,2005 07:44 PM UTC Nov 9,2005 04:34 PM UTC Windows Forms 4
loading
Tags: GridControl
Mike
Asked On November 7, 2005 07:44 PM UTC

I recreated the painting problem with DrawClippedGrid even in 2.9.0.1. I''m using PerformanceGrid from 2.9.0.1 performance sample. I simply copied DrawClippedGrid from 3.3 and added the method to my grid.

GridNoBorderOverpaint.zip

Administrator [Syncfusion]
Replied On November 9, 2005 12:29 PM UTC

Mike, I noticed that there is a drawing issue when HScrollPixel = true is set and you horizontally scrolled. Is that the case in your example? The TraderGridTest has by default HScrollPixel = false. That''s why I didn''t notice it there. I am a bit at loss what version 2.9.0.1 is. Do you have some special private patch? Stefan >I recreated the painting problem with DrawClippedGrid even in 2.9.0.1. > >I''m using PerformanceGrid from 2.9.0.1 performance sample. I simply copied DrawClippedGrid from 3.3 and added the method to my grid.

GridNoBorderOverpaint.zip

Administrator [Syncfusion]
Replied On November 9, 2005 12:58 PM UTC

>>I simply copied DrawClippedGrid When I tried to move the DrawClippedGrid method exposed in the 3.3 GriControlbase into the performance sample of 2.1.0.9, I could not get it to work. The DrawClippedGrid accesses private members of GridControlBase. Can you upload a sample that I can run with 2.1.0.9 and see the problem?

Mike
Replied On November 9, 2005 03:50 PM UTC

Attached is the 3.3 TraderGrid screen shot. I meant 2.1.0.9, sorry. I copied and changed code from 3.3. I added the following method to my GridControl in 2.1.0.9 codebase: public void DrawClippedGrid( Graphics g, bool shouldClip, Rectangle rectClip ) { // Get rectangle to be drawn. if (rectClip.IsEmpty) rectClip = this.GridBounds; else if (!rectClip.IntersectsWith(this.GridBounds)) return; // ... nothing needs drawn rectClip = Rectangle.Intersect(this.GridBounds, rectClip); if (shouldClip) g.SetClip(rectClip); // Compute rows and colums. int topRow, leftCol, bottomRow, rightCol; this.ViewLayout.RectangleToClientRowCol(rectClip, out topRow, out leftCol, out bottomRow, out rightCol, GridCellSizeKind.ActualSize); topRow = Math.Max(0, topRow); leftCol = Math.Max(0, leftCol); this.OnDrawClientRowCol(topRow, leftCol, bottomRow, rightCol, g, rectClip); } >>>I simply copied DrawClippedGrid > >When I tried to move the DrawClippedGrid method exposed in the 3.3 GriControlbase into the performance sample of 2.1.0.9, I could not get it to work. The DrawClippedGrid accesses private members of GridControlBase. > >Can you upload a sample that I can run with 2.1.0.9 and see the problem?

TraderGridIssue.zip

Administrator [Syncfusion]
Replied On November 9, 2005 04:34 PM UTC

I can see the problem of the numbers overwriting in the 3.3 sample when you resize the form to enlarge the grid. The drawing is still being clipped to the original size. I think you can avoid this problem in the 3.3 sample by handling the Form.SizeChanged event and recreating the cached graphics object at that point.
private void Form1_SizeChanged(object sender, EventArgs e)
{
	if (drawDirectToDC )
	{
		if(g != null)
		{
			g.Dispose();
			g = m_syncGrid.CreateGridGraphics();
		}
	}
}

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.

Warning Icon 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.Close Icon

;