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?????
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.
ADAdministrator Syncfusion Team July 14, 2005 05:51 PM
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)
style.Control = Nothing
If Not Me.ShouldDrawFocused(rowIndex, colIndex) Then
staticGridInCell.Tag = New Point(colIndex, rowIndex)
style.Control = staticGridInCell
activeGridInCell.Tag = New Point(colIndex, rowIndex)
style.Control = activeGridInCell
Dim planifGridUC As PlanificationGridUC = Grid.Parent
MyBase.OnDraw(g, clientRectangle, rowIndex, colIndex, style)
End Sub ''OnDraw