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.

ProgressBarCells sample application keeps crashing

Thread ID:





8981 Dec 1,2003 01:02 PM Dec 6,2003 02:59 PM Windows Forms 7
Tags: GridControl
Asked On December 1, 2003 01:02 PM

I am currently evaluating the essential grid and am going through the sample applications included with the eval. I want to be able to update the grid very frequently and have good performance. The ProgressBarCells sample seems to demonstrate this once checking the animate check box however when I make use of the splitter functionality located on the corners and resize the splitters it crashes frequently (Throws an exception). Is the grid very unstable when updated frequently?

Administrator [Syncfusion]
Replied On December 1, 2003 06:38 PM

That sample fires a timer every 10 msecs. When you split things in 4 panes, you have 4 such timers firing every 10 msecs on the same UI thread. This is bogging things down. Here is a sample that uses multiple threads to avoid bogging down the UI thread. http://www.syncfusion.com/support/user/Uploads/multithread_1079.zip

Replied On December 5, 2003 12:47 PM

Even though it gets booged down should it be throwing unhandled exceptions? What exactly is causing it to throw exceptions? If it is getting bogged down then shouldnt it just go slower?

Administrator [Syncfusion]
Replied On December 5, 2003 01:39 PM

The problem is that the timer tick is fired before the previous timer tick is completed. This means that the Application.DoEvents(); at the bottom of the timer tick event is really never hit, and window messages are just being queued and not processed, with the Timer Tick events just getting queued up. So, if you move the Application.DoEvents(); from the bottom to the top of the timer tick event, things work more smoothly, but still bog down.

Administrator [Syncfusion]
Replied On December 5, 2003 03:02 PM

The correct implementation would actually be to have only one timer fired that updates the grids progress bar values through the model. It''s just that in the ProgressBarSample sample we didn''t consider the case that all four panes are open and then 4 timers compete with each other. Stefan

Administrator [Syncfusion]
Replied On December 6, 2003 02:00 AM

Setting a flag to avoid multiple calls into the tick handler seems to handles things. You can scroll the panes slightly to see the faster moving progressbars, and size the form without locking up.
private bool inTimer = false;
private void timer_Tick(object sender, EventArgs e)
	this.inTimer = true;
	for (int rowIndex = 3; rowIndex < 14; rowIndex += 2)
		GridStyleInfo style = gridControl1[rowIndex, 2];
		GridProgressBarInfo progressBarEx= style.ProgressBar;
		int pvalue = (progressBarEx.ProgressValue + rowIndex)%100;
		progressBarEx.ProgressValue = pvalue;
	this.inTimer = false;

Replied On December 6, 2003 09:40 AM

I made the changes to the sample and it still throws exceptions occasionally. It only seem to throw them now when I animate the progress bars, then create a split pane then close the split pane. When I close the split pane it throws the following exception. Is this easily fixed? System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: rowIndex at Syncfusion.Windows.Forms.Grid.GridModel.SetCellInfo(Int32 rowIndex, Int32 colIndex, GridStyleInfo style, StyleModifyType modifyType, Boolean dontRaiseSaveCellInfoEvent, Boolean copyReferenceOnly) at Syncfusion.Windows.Forms.Grid.GridModel.SetCellInfo(Int32 rowIndex, Int32 colIndex, GridStyleInfo style, StyleModifyType modifyType) at Syncfusion.Windows.Forms.Grid.GridModel.ChangeCells(GridRangeInfo range, GridStyleInfo[] cellsInfo, StyleModifyType modifyType) at Syncfusion.Windows.Forms.Grid.GridModel.Syncfusion.Windows.Forms.Grid.IGridVolatileDataContainer.ChangeCell(Int32 rowIndex, Int32 colIndex, GridStyleInfo style) at Syncfusion.Windows.Forms.Grid.GridVolatileData.set_Item(Int32 rowIndex, Int32 colIndex, GridStyleInfo value) at Syncfusion.Windows.Forms.Grid.GridStyleInfoIdentity.OnStyleChanged(StyleInfoBase style, StyleInfoProperty sip) at Syncfusion.Styles.StyleInfoBase.OnStyleChanged(StyleInfoProperty sip) at Syncfusion.Windows.Forms.Grid.GridStyleInfo.OnStyleChanged(StyleInfoProperty sip) at Syncfusion.Styles.StyleInfoBase.OnSubObjectChanged(IStyleInfoSubObject subObject) at Syncfusion.Styles.StyleInfoSubObjectBase.OnStyleChanged(StyleInfoProperty sip) at Syncfusion.Styles.StyleInfoBase.SetValue(StyleInfoProperty sip, Object value) at Syncfusion.Windows.Forms.Grid.GridProgressBarInfo.set_ProgressValue(Int32 value) at GridSample.MainForm.timer_Tick(Object sender, EventArgs e) in c:\program files\syncfusion\essential suite evaluation\grid\samples\celltypes\progressbarcells\cs\mainform.cs:line 402 at System.Windows.Forms.Timer.OnTick(EventArgs e) at System.Windows.Forms.Timer.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr idEvent, IntPtr dwTime)

Administrator [Syncfusion]
Replied On December 6, 2003 02:59 PM

You need to add splitter_PaneCreated and splitter_paneClosing event to subscribe to the CurrentCellChanged event. If you don''t do this, then when you close a pane, the event is lost. You also have to change the CurrentCellChanged event handler to used the sender to get at the grid. Here is a new mainform.cs file with these changes.


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.