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 font enlages, red crosses in cells, app crashes. (2.1.0.9)

Thread ID:

Created:

Updated:

Platform:

Replies:

33186 Aug 15,2005 09:08 PM UTC Sep 1,2005 08:46 PM UTC WinForms 9
loading
Tags: GridControl
Mike
Asked On August 15, 2005 09:08 PM UTC

Some user have reported the grid font becomes large and red crosses appear in cell in the place of cell values. The application later throws an unrecoverable error, not a unhandled .NET exception. I''m using Performance Grid in virtual mode with UseGDI and Double buffering on. Has anyone ever reported this or similar problem? Any suggestions, ideas?

Administrator [Syncfusion]
Replied On August 15, 2005 10:30 PM UTC

Red crosses suggest exceptions are being thrown during the drawing code. Are you trying to use multiple threads? If so, you must make sure you only try to access grid methods on the thread that created the grid. One way to do this is to use grid.InvokeRequired checks to test whether you need to use a grid.Invoke to make sure the code is being executed on the grid''s thread. Here is a KB on this issue. http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=78

Mike
Replied On August 15, 2005 11:03 PM UTC

I''m using multiple threads extensively. All updates are performed using BeginInvoke. Its unlikely this problem is caused by the threading rule violations. In addition, cells that have a control type, say, check box, turn red and the content reads "Exception". Somehow I think the problem is related to low memory.

Administrator [Syncfusion]
Replied On August 16, 2005 12:41 AM UTC

Instead of BeginInvoke, try using Invoke.

Mike
Replied On August 16, 2005 09:08 PM UTC

This would block the calling thread and is an undesirable change. Another symptom of this problem is ALL the grids in ALL the windows start having this issue at the same time. My code event resizes columns to fit the new font when it happens. It may have to do with weak font references and lack of system resources. >Instead of BeginInvoke, try using Invoke.

Administrator [Syncfusion]
Replied On August 17, 2005 01:07 AM UTC

You probably should be able to make it work with BeginInvoke but it does require great care. From the time the BeginInvoke is called until the time the grid handles the call you have to make sure that the data the grid wants to draw have not become out of date. Say for example, you insert a row, make a BeginInvoke and later delete a row and only after you delete the row the grid gets the insertion message you are in trouble. The grid will want to get the data for the inserted row which does not exist anymore and will throw an exception. You also have to consider cases where you change a cell and insert a row or if you delete rows then change cells etc. If you can make sure that the data are in sync with what the grid is expecting them to be than BeginInvoke should work. But it is not an easy task to make sure things stay in sync. 2.1.0.9 also had a problem with checkbox cells not being threadsafe. This and also another threading problem with 2.1.0.9 with attaching to a DataSet are mentioned in forum thread http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=28722.

Administrator [Syncfusion]
Replied On August 29, 2005 02:59 PM UTC

The grid updates take place within the same BeginInvoke as the repaints. This may be less efficient but takes care of the synchronization issues. The font seems still to be a resource issue. It reminds me of old days when Windows used to use the system font when it has reached resource limits. Is it possible that I use the QueryCellInfo in a way that it forces the grid to reallocate fonts too frequently that the system runs out of recourses? When I receive market updates I paint cells with different color. I never change the grid font which is supplied in the table style (All my styles derive from my table style). All my variety of styles is basically colors. In the QueryCellInfo handler I just call this: e.Style.ModifyStyle( myStyle, StyleModifyType.Override ); What do you think?

Administrator [Syncfusion]
Replied On August 29, 2005 03:13 PM UTC

How/how often is myStyle being created? Are you explicitly do a new GridStyleInfo? If so, after you have finished with myStyle, are you calling myStyle.Dispose? Unless you are cacheing new GridStyleInfo objects over and over again without disposing them, my educated guess is that you may still be seeing a threading issue.

Administrator [Syncfusion]
Replied On September 1, 2005 07:32 PM UTC

The problem with enlarged fonts happens on the grids that do not use the check box. I create myStyles only when a form opens. Then I just look it up in the QueryCellInfo and call e.Style.ModifyStyle( myStyle, StyleModifyType.Override ); Is it possible that the font problem is related to the one described here: http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=18559? It’s possible that due to a bug in an MDI application references to windows/grids/fonts not being GCed so eventually the system runs out of handles…

Administrator [Syncfusion]
Replied On September 1, 2005 08:46 PM UTC

The change mentioned in http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=18559 is in our current code base. You might consider trying the 3.3 code to see if it solves your porblem. 3.3 and 2.1.0.9 have different assembly names so it is usually no problem keeping both sets of libraries in the GAC. Or, if you have the source, you can try modifying it as the customer did in 18559 to see if it solves the problem you are seeing. If you can send us a sample project showing the problem, we can test it with 3.3 here to see if it handles the issues you have. And if it does not, we can debug it to see what needs to be done.

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

;