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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid redrawing messing up.... Plz help Clay!!

Thread ID:





31795 Jul 14,2005 03:17 PM UTC Jul 14,2005 10:51 PM UTC WinForms 2
Tags: GridControl
Martin Cyr
Asked On July 14, 2005 03:17 PM UTC

Here is the project, please open it and try this : Select a cell (with text) and click on another cell. Go back to the previous cell and move again. The last active subcell should now follow you anywhere you go... WTF??? How can I fix this????? Grid-Broken_2602.zip

Martin Cyr
Replied On July 14, 2005 04:19 PM UTC

Fixed it!! This is one of the most incidious bugs I ever seen, I personnaly spent 3 days on it, my boss about half a day. I believe the blame would be on your codebase. The usercontrol.visible gets set to true when drawn, it seems, but never turned back to visible=false. I simply added on the parent grid, in the CurrentCellMoving, usercontrol.visible=false... magic! Please check the codebase if there wouldn''t be something that could be fixed to avoid such events in the future.

Administrator [Syncfusion]
Replied On July 14, 2005 10:51 PM UTC

Below is a version of OnDraw that I think also handles this problem without using the CurrentCellMoving event. In GridGenericCellRenderer.OnDraw, if the style.Control is hidden, it properly positions it and makes it visible. If it is already visible, then the base class assumes it does not need to be positioned. Protected Overrides Sub OnDraw(ByVal g As System.Drawing.Graphics, ByVal clientRectangle As System.Drawing.Rectangle, ByVal rowIndex As Integer, ByVal colIndex As Integer, ByVal style As Syncfusion.Windows.Forms.Grid.GridStyleInfo) clientRectangle.Inflate(-1, -1) style.Control = Nothing If Not Me.ShouldDrawFocused(rowIndex, colIndex) Then staticGridInCell.Tag = New Point(colIndex, rowIndex) staticGridInCell.Refresh() style.Control = staticGridInCell Else activeGridInCell.Tag = New Point(colIndex, rowIndex) activeGridInCell.Refresh() style.Control = activeGridInCell Dim planifGridUC As PlanificationGridUC = Grid.Parent planifGridUC.ActiveUserControl.Hide() End If MyBase.OnDraw(g, clientRectangle, rowIndex, colIndex, style) End Sub ''OnDraw


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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