Hi,
I have a grid that was bound to a hierarchical entity structure. All worked well except for the fact that it loaded all the records and took several minutes to display with lots of data (the grid in fact took a lot longer to display the data than it did to grab from the db). So, looking around at your documentation I decided to use the ultrawindatasource.
So far so good. Load times are a fraction using load on demand. Well, sort of. In our system:
This all worked without me writing any code when using a bindingsource directly on the grid (except for saving in the aftercellupdate handler). Is there any way (examples would be handy) I can use binding on the ultrawindatasource so that updates/edits are automatically applied to the underlying entities? If not I will be writing plumbing code for days! (our grids are big)
Regards,
Rich
Hi Rich,
If I understand you correctly, what you are doing here is using the UltraDataSource in on-demand mode so that the grid doesn't load all of the data at once.
Richard Gobbett said:Is there any way (examples would be handy) I can use binding on the ultrawindatasource so that updates/edits are automatically applied to the underlying entities?
I'm not quite sure what you mean by "automatically". What you have to do is handle the events of the UltraDataSource and write the data from the UltraDataSource to your 'real' data source. There's no way the grid can do this automatically, it has no knowledge of the entities, nor does the UltraDataSource.
Richard Gobbett said:If we could bind the list object to the ultrawindatasource's row object (currently stored in the .Tag property) we could keep our system working as-is, which is the preferred option (less coding and retesting). Can you advise on the best way to do this? I'm assuming that we would have to manually bind as the grid requests each row on the ultrawindatasource?
I don't think there's any way to do this.
Ok, looks like I will have to come up with a pattern to handle this scenario, manually hand cranking the whole thing will be too much work and likely to introduce a bunch of errors. Shouldn't be too difficult with LLBLGen's entity framework as each entity has a string field index and object value so can probably do some sort of dictionary look up to map to/from cells based on the names.
On another note, any idea why this happens in the designer every now and then?
https://skydrive.live.com/redir?resid=A49518DE07FE55F0!2499
Each of those black lines appears to be a splitter that if you drag off the screen seems to disappear. Annoyingly, all the columns become visible though and the whole thing needs to be re-designed. Any ideas?
There's no reason I can think of why splitters would appear in the grid spontaneously. If your grid is losing it's layout, or columns are losing their hidden state, it might be because your data source is sending a Reset notification to the grid.
You can turn off the splitters by setting MaxColScrollRegions and MaxRowScrollRegions to 1, though.
Yeah I have both those properties set to 1 already, weird.
Back to my original issue. I have managed to improve the performance of the grids quite drastically by removing all sorting/grouping and doing that DB side or sorting-on-demand when expanding to a sub-band. The difference is pretty huge, it performs at least twice as fast, if not better. Do you have any other tips/tricks or advise on how to speed the grids up when using a normal bindingsource? that doesn't include switching to an ultrawindatasource :)
My grid is anything from 250-500 rows, 5 bands deep, each of which is bound to an LLBLGen entity with multiple update-able cells . I have set load on demand but not sure what that is doing with a standard winforms bindingsource?
I'm pretty close performance-wise now, just those last few seconds to save and I think that will do it. Currently I am at 40 seconds to load the data from the DB and a further 27 to draw the grid (this is my worst case scenario).
Have you read the WinGrid Performance Guide ?