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

GGC - performance on updating column values

Thread ID:





35380 Sep 28,2005 10:43 PM UTC Sep 28,2005 11:45 PM UTC WinForms 1
Tags: GridControl
Nancy Jan
Asked On September 28, 2005 10:43 PM UTC

Hi, How to get the best performance when update a column value for the entire grid? The code below is very slow even with just a couple thousand records. for (int i=0; i

Administrator [Syncfusion]
Replied On September 28, 2005 11:45 PM UTC

Jan, try to handle the SourceListListChanged event. In the event handler you can give the engine couple of instructions what to do when it receives the ListChanged event (which occurs because of the record column change...). bool inUpdatingFields = false; // set this before changing values and reset it afterwards void yourUpdateMethod() { inUpdatingFields = true; foreach (SelectedRecord sr in this.grid.Table.SelectedRecords) { sr.Record.setValue(columnName, newValue); } inUpdatingFields = false; this.grid.Refresh(); } protected override void ggc_SourceListListChanged(object sender, TableListChangedEventArgs e) { if (e.ListChangedType == ListChangedType.ItemChanged && inUpdatingFields) { // Set this false if changes in values do not change sort order of parent groups (this is the case only if sort by summary values of groups). e.ShouldInvalidateGroupSortOrder = false; // If record changes do not affect filter logic and summaries set this false. e.ShouldInvalidateCounters = false; // If sort order of records is affected then setting // these value to false will have no effect. The engine will always invalidate its counters in that case. e.ShouldInvalidateSummaries = false; // GridTableControl listens to SourceListRecordChanged event and will execute the following code: // if (e.SortedPositionChanged) // tableControl.Invalidate(); // else if (e.TableListChangedEventArgs.ShouldInvalidateScreen) // { // ViewLayout.Reset(); // InvalidateElement(e.Record); // } // Setting e.TableListChangedEventArgs.ShouldInvalidateScreen = false will prevent the ViewLayout.Reset // and InvalidateElement calls from happening and we can implement a more optimized way to redraw these elements. e.ShouldInvalidateScreen = false; // let''s do our own drawing if sort order is not affected (or let''s do no drawing at all and simply call Update at the end) } Stefan >Hi, > >How to get the best performance when update a column value for the entire grid? The code below is very slow even with just a couple thousand records. > > >for (int i=0; i{ > this.grid.Table.SelectedRecords[i].Record.setValue(columnName, newValue); >} >this.grid.Refresh(); > >Regards, >NJ >


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

or the page will be automatically redirected to 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