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.

ResumeBinding

Thread ID:

Created:

Updated:

Platform:

Replies:

37947 Dec 2,2005 10:48 AM Dec 5,2005 12:09 PM Windows Forms 6
loading
Tags: GridControl
Christopher Dugdale
Asked On December 2, 2005 10:48 AM

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 11:44 AM

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 01:11 PM

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

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

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 07:05 AM

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 09:57 AM

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 12:09 PM

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!

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.

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.

;