I found that UltraGrid is very slow to refresh after i make changes to the attached UltraDataSource. I followed Mike's article about UltraGrid's performance and added
this.ultraGrid1.BeginUpdate();this.ultraGrid1.SuspendRowSynchronization();
and corresponding Resume and EndUpdate functions but that didn't improve matters much. After some experimenting I got reasonable performance if I just set DataSource of my grid to NULL, do changes to data source and then assign my data source back to grid.
I just think I'm missing something here.
Hi Sunil,
The grid is a user interface control. It's designed for user interaction. So if you are performing a mass update on your data in code, it doesn't make a lot of sense to do it through the grid. You'd be better off modifying your data source directly instead of going through the UI.
Of course, if you do that, the grid will get notifications from the data source, so you probably want to turn those off so the grid doesn't respond to each one individually and slow things down.
grid.BeginUpdate(); grid.SuspendRowSynchronization(); try { // Loop through the data source and update the data here. } finally { grid.ResumeRowSynchronization(); grid.EndUpdate(); }
grid.BeginUpdate(); grid.SuspendRowSynchronization();
try { // Loop through the data source and update the data here. } finally { grid.ResumeRowSynchronization(); grid.EndUpdate(); }
Hi,
I am calling "grid.UpdateData()" method after modifying data from code behind. It is taking too much time. My code as below:
for (int i = 0; i < grid.Rows.Count; i++){ UltraGridRow row = this.Rows[i]; row.Cells[this.ActiveCell.Column].Value = this.ActiveCell.Value; }
grid.UpdateData();
So here if I am updating 80k records then this for loop takes ~10sec and "grid.UpdateData()" method takes ~80sec.
Is it usual?
Or is there any better way to implement it?
Thanks,
Sunil
Hello,
I believe that you have come to resolution in the mentioned thread by you: http://community.infragistics.com/forums/t/57190.aspx.
Please do not hesitate to contact us if you need any additional assistance.
Lev, I have a similar problem now where adding columns to bands to my children causes a significant increase in load up time for the grid.
My situation does not allow me to set the datasource of the grid to null, update the UltraDataSource and then rebind it. Did you figure out a different solution to this problem?
I posted more details of my situation with a total of three problems on the following thread
http://community.infragistics.com/forums/t/57190.aspx
If anyone from the Infragistics team needs a simple little project that reproduces any of the problems highlighted let me know as i have one waiting.
So far i have had to put the main updating call on the GUI thread to stop the grid kiling my app and just taking the hit of the speed degradation.
Thanks Mike,
8 Bands is a large number when you pull data from joined tables in database - I agree with you on that one, i haven't seen many queries that join more than 8 tables.
When you populate your own UltraDataSource with adhoc data or your data has a recursive relationship you can very easily have very large number of bands. In my application I have a recursive parent/child relationship with many levels of nesting, and each parent level requires creation of a new band.
I guess I'll stick with unbind, populate and bind again approach for now.