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.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

31795 Jul 14,2005 11:17 AM Jul 14,2005 06:51 PM Windows Forms 2
loading
Tags: GridControl
Martin Cyr
Asked On July 14, 2005 11:17 AM

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 12:19 PM

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 06: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) 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

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.

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.

;