Wingrid marked Cross if you are not using screen for sometime
As the above screen shot displayed..above...my all grid marked cross ...automatically ...any idea ..why this happens ..?
Hi,
The big red X in an control means that an exception occurred in that control's OnPaint method.
This can be caused by a bug in the control, but more often it's the result of improper use of multiple threads in an application which causes the control to get out of synch with it's data source.
Is your application using threading?
Hi Mike,
We have 6 grids in this form.We are loading some user controls(containing images,progress bar) etc to the grid cells.We are also loading some image boxes (created dynamically) to the cells.When the initial load happens everything is going smoothly.
We have an option in this form for refreshing the grids as per the time interval set by user.For that we are using a timer.The refresh process also is happening properly for a couple of times.After that ,during 5th or 6th refresh, we are getting this problem.Once this happens,the application hangs but the timer tick event is not stopping.
Do you have any suggetions or solutions for this X mark issue?
Hi Hristo,
Many thanks for your reply.Your suggestion will work.But in our case situation is different.
We are diplaying different data(images,controls etc) in each grid.If we follow your suggestion all
cells(of each grid) will display the same data(the latest data assigned while binding the last grid's
cells).Re-use will reduce memory consumption but it won't help us in delivering the required output.
Could you please provide any other solution?
Thanks,
Prasant
Hi
in our case we need to re-instantiate the container object for every individual cells in grid ... as we have diffrent values and images to reprensents for each grid cells ..based on our business logic...so please suggest us any other resoultion u have
Many thanks in advance..
I just wanted to know if you were able to solve your issue based on Mike's suggestions or you still need help. Just let me know.
Thank you
No luck.This solution is not applicable for us.Let me explain what we trying to achieve and how we are doing it.We have 5 grids in a form each displaying different data.The content in each cell can either be any of the following.1)User control 2)Combination of images and controls(label,progess bar etc).User control contains picture box,label,progess bar etc.Based on the value in the data set we are displaying the user controls or combination of images and controls (created dynamically).
We are binding these items to the container and then placing the container inside the cell.So the solution provided by Mike won't help us as data in each cell different.Mike suggested us to use the same container for displaying the same user control inside the grid.This won't help us as we are placing some other information inside the grid other than the user control.This information will be different for different cells eventhough the user control displayed is same.So we will have to use different containers for displaying the information.
We tried disposing the objects for each cell before rebinding the grid.Please find the methods mentioned below.
private static void DisposeObjects(UltraControlContainerEditor utraContainer) { if (utraContainer != null) { if ((utraContainer.RenderingControl.GetType().BaseType == typeof(UserControl))) { UserControl userControls = (UserControl)utraContainer.RenderingControl;
foreach (Control ctl in userControls.Controls) { if ((ctl.GetType() == typeof(TableLayoutPanel))) { TableLayoutPanel tblPnObj = (TableLayoutPanel)ctl; DisposeTableObjects(tblPnObj); } }
if (userControls.IsDisposed) { userControls.Dispose(); } } else { TableLayoutPanel tblpnl = (TableLayoutPanel)utraContainer.RenderingControl; DisposeTableObjects(tblpnl);
} utraContainer.Dispose(); GC.Collect(); } }
private static void DisposeTableObjects(TableLayoutPanel tblPnl) { Control cntrol = null; if (tblPnl != null) { foreach (Control ctl in tblPnl.Controls) { if ((ctl.GetType() == typeof(UltraPictureBox))) { UltraPictureBox picBoxObj = (UltraPictureBox)ctl; picBoxObj.Dispose(); }
if ((ctl.GetType() == typeof(UltraExpandableGroupBox))) { UltraExpandableGroupBox GroupBoxObj = (UltraExpandableGroupBox)ctl; GroupBoxObj.Dispose(); }
if ((ctl.GetType() == typeof(UltraButton))) { UltraButton buttonObj = (UltraButton)ctl; buttonObj.Dispose(); }
if ((ctl.GetType() == typeof(UltraLabel))) { UltraLabel buttonObj = (UltraLabel)ctl; buttonObj.Dispose(); } } }
}
Please suggest any other solution .
Hello,
I am just checking about the progress of this issue
I believe we answer your question. Let me know if you have any further questions or I may close this case.
Thank you contacting us for this question.