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

ProgressBarCells sample application keeps crashing

Thread ID:

Created:

Updated:

Platform:

Replies:

8981 Dec 1,2003 06:02 PM UTC Dec 6,2003 07:59 PM UTC WinForms 7
loading
Tags: GridControl
Ryan
Asked On December 1, 2003 06:02 PM UTC

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 11:38 PM UTC

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

Ryan
Replied On December 5, 2003 05:47 PM UTC

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 06:39 PM UTC

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 08:02 PM UTC

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 07:00 AM UTC

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)
{
	if(this.inTimer)
		return;
	this.inTimer = true;
	Application.DoEvents();
	gridControl1.BeginUpdate(BeginUpdateOptions.Invalidate);
	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;
	}
	gridControl1.EndUpdate(true);
	this.inTimer = false;
}

Ryan
Replied On December 6, 2003 02:40 PM UTC

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 07:59 PM UTC

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.

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

;