Batching Sample

Posted by Admin on 07-Aug-2008 14:45

Please find attached on of the batching samples that I've used during my Exchange session. The session slides are also available on PSDN or the Exchange side. Search for DEV-40.

My goal was to add additional comments to the sample before publishing it, but as Thomas asked for a sample in a different thread, I thought it might be a good chance to share it up front.

The sample use a SDO as it's data supplier. Why? Because there is no other commonly used data source in the ABL that is even powerful, has batching support and is supported by tools... No - truly, using SDOs and other ADM2 smart objects with the Advanced GUI was one of the biggest challenges when building my Dynamics rendering engine for the Advanced GUI.

The sample files belong in a folder samples/SDOForm and a sports2000 database is required for the customer SDO.

Most interesting pieces of code are in the InitializeDataObject method of the SDOForm.cls and the bindingSource1_OffEnd and ultraGrid1_BeforeSortChange event handlers.

If you'd like to see that session live again, please join me while repeating this session at PSDN live in Boston

[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/19/batching-sample.zip:550:0]

All Replies

Posted by rbf on 08-Aug-2008 05:44

Excellent work Mike!

Thank you for posting this code. As you know I sat front row during your presentation in Paris and cannot wait to try your code.

Posted by vancejohnson2 on 13-Aug-2008 15:08

Mike, can you please explain how the example should be set up. I have zero familiarity with SDOs, so please be patient. I have a c:\batching folder with your samples\SDOForm as a sub-folder. I have a connection to a copy of the Sports2000 database, which is in the SDOForm folder. My start-in folder is c:\batching. When I try to run run.p, I get the attached error. If I start in c:\batching\samples or c:\batching\samples\SDOForm, I get:

Invalid datatype specified: samples.SDOForm.SDOForm. Specify a datatype such as 'character' or the name of a class. (5638)

    • Could not understand line 16. (196)

What am I doing wrong?

Posted by Admin on 13-Aug-2008 15:38

Hi Vance,

you are right to try to run the run.p - but you don't have a problem with the SDO. It's the SDOForm.cls that's either not available in a relative path samples\SDOForm or does not compile for some reason.

Can you try to compile the SDOForm? Any errors?

What's the result of

MESSAGE SEARCH("samples\SDOForm\SDOForm.cls") VIEW-AS ALERT-BOX.

and a

MESSAGE SEARCH("samples\SDOForm\SDOForm.r") VIEW-AS ALERT-BOX.

[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/19/assemblies.xml:550:0]

I have attached my assemblies.xml file. Maybe that helps. You need to have a reference to the Infragistics Grid assemblies to be able to compile the file. (Ignore the 3 entries in the file starting with Consultingwerk. You don't need them and they should not disturb.

Posted by Admin on 13-Aug-2008 15:44

Ok. I just saw right now, that you attached a picture with an error message (the email notification does not show if there's an attachment).

It's definitively an issue with the assemblies.xml. The Infragistics UltraToolbar assemblies are not available. My assemblies.xml should resolve that issue.

Posted by Simon de Kraa on 16-Aug-2008 09:51

I stumbled across the WinDataSource / Virtual Mode example and I am wondering how this relates to the LoadOnDemand setting for the UltraGrid?

Can this be used for batching as well? Or does this only work with the UltraDataSource (built-in batching support?).

And how do the UltraDataSource and ProBindingSource relate to each other?

Just wondering...

// Set the LoadStyle to LoadOnDemand for virtual loading. With LoadStyle set to

// LoadOnDemand, UltraGrid will not create all of the rows at once. It will create

// rows when they are needed (which typically is when they are scrolled into view).

this.ultraGrid1.DisplayLayout.LoadStyle = LoadStyle.LoadOnDemand;

Posted by Håvard Danielsen on 18-Aug-2008 16:36

The LoadOnDemand does not affect the ProBindingSource. I do think you would have to use it if you were to support batching in an UltraDataSource, as it tells the UltraGrid not to preload the data, but only ask for it when needed. You can then write code in UltraDataSource events to load data when requested. (The UltraGrid will ignore this setting if any method or attribute needs all data, like summaries, sorting and filter support. This seems to be a common disclaimer anywhere this option is discussed.)

I believe we shipped two samples with this in the Beta. WinGrid (Or UltraWinGrid or UltraGrid)/SamplesExplorer/frmUltraDataSource1 and frmUltraDataSource2.

These are very simplistic, but highlights the usage. The first sample does not even have any data, it just adds some simulated data in the CellDataRequested event.

The second sample is using a Progress query for the data, which still is random generated. The UltraDataSource is used only for the events and the CellDataRequested event is actually returning data from a Progress query. This highlights that you also can use LoadOnDemand with Progress data, just not with the ProBindingSource.

I do not know the specific differences of the two classes. I am assuming the best choice for batching is a ProBindingSource with batching on, but that there perhaps could be more complex cases where LoadOnDemand could give more control, since it has events on cell level.

This thread is closed