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. Image for the cookie policy date
close icon

DrawClippedGrid painting issues

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

4 Replies

AD Administrator Syncfusion Team 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


AD Administrator Syncfusion Team 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?


MI Mike 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


AD Administrator Syncfusion Team 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();
		}
	}
}

Loader.
Live Chat Icon For mobile
Up arrow icon