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


Thread ID:





37947 Dec 2,2005 03:48 PM UTC Dec 5,2005 05:09 PM UTC WinForms 6
Tags: GridControl
Christopher Dugdale
Asked On December 2, 2005 03:48 PM UTC

Hi, I call suspend binding before I make bulk updates to the grid. However, when I call resume binding the state of expanded rows is lost and they are all collapsed. Why does this happen? And how can I prevent it? Cheers

Administrator [Syncfusion]
Replied On December 2, 2005 04:44 PM UTC

What grid are you using? This will happen in a GridDataBoundGrid but should probably not happen in a GridGroupingControl (depending on what exactly you are doing). In a GridDataBoundGrid, then you woul dhave to save the expand states before the updates and restore them afterwards. This takes some coding. Here is forum thread that discusses saving the expand state during a sort. I think you can use a similar techique for this problem. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=16065

Christopher Dugdale
Replied On December 2, 2005 06:11 PM UTC

Yes it is a GDBG. Does doing a ResumeBinding cause the Grid to reset?

Administrator [Syncfusion]
Replied On December 2, 2005 07:11 PM UTC

If you have this flag set, grid.OptimizeListChangedEvent = true, then yes, it does cause a reset. public void ResumeBinding() { if (suspendBinding > 0) { if (--suspendBinding == 0) { if (this.OptimizeListChangedEvent) { if (suspendChangeFlags != 0) { suspendChangeFlags = 0; this.bindingList_ListChanged(this.List, new ListChangedEventArgs(ListChangedType.Reset, -1, -1)); } } else { gridModel.BeginUpdate(); if ((this.suspendChangeFlags & MetaDataChangedFlag) != 0) { MetaDataChanged(); } else if ((this.suspendChangeFlags & DataSourceChangedFlag) != 0) { listManager_Changed(this.listManager, EventArgs.Empty); } else if ((this.suspendChangeFlags & DataSourceRowChangedFlag) != 0) { listManager_CurrentChanged(this.listManager, EventArgs.Empty); } else if ((this.suspendChangeFlags & DataSourcePositionChangedFlag) != 0) { listManager_PositionChanged(this.listManager, EventArgs.Empty); } suspendChangeFlags = 0; gridModel.EndUpdate(); } } } }

Christopher Dugdale
Replied On December 5, 2005 12:05 PM UTC

Hi, I have multiple updates(around 60) being performed on the GDBG approx every 250 - 500 ms. During the update phase I call BeginUpdate and SuspendBinding and then EndUpate and ResumeBinding upon completion of the update to the underlying data. I presume it would be a large processing overhead to have OptimizeListChangedEvent set to true as a call to ResumeBinding would then cause a full reset on a frequent basis? The frequency of this would be inefficient? However, without OptimizeListChangeEvent set to true, the grid does not reflect any of the underlying data chanages after I call EndUpdate and ResumeBinding. How can I then get the grid to update itself or is a reset the only way?

Administrator [Syncfusion]
Replied On December 5, 2005 02:57 PM UTC

After calling EndUpdate, try also calling grid.Refresh to see if this will allow the new values to be seen.

Christopher Dugdale
Replied On December 5, 2005 05:09 PM UTC

That works great. And the fact a reset hasn''t occured also means I dont lose the expanded/collapsed row state which is good. However to execute refresh on average takes 500 to 600 ms. This appears to interfere and delay other GUI events/messages such as keypress and mouse click events. Are there any tricks to improve this refresh time or improve the processing of other messages on the message pump? Thanks for your help!


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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