Ultragrid + probinding source

Posted by Admin on 17-Sep-2008 09:47

Hi,

This might be simple but I can't seem to get it work..

I have an ABL form with an Ultragrid and a probinding source.

I have two buttons "get Records", "get Next Set".

When I press "get records" I instantiate a new class (which contains the definition of dataset and logic to fill it) and assign the

proBindingSource:handle = handle of dataset.

when I press "get Next set" I get the next set of records into the dataset but how do I get these records to show in UltraGrid? (or refresh bindingsource ??)

I have tried refreshAll() but that does not help.

Any pointers will be greatly appreciated.

Thanks,

Parul.

All Replies

Posted by Peter Judge on 17-Sep-2008 12:16

Hi,

This might be simple but I can't seem to get it

work..

I have an ABL form with an Ultragrid and a probinding

source.

I have two buttons "get Records", "get Next Set".

When I press "get records" I instantiate a new class

(which contains the definition of dataset and logic

to fill it) and assign the

proBindingSource:handle = handle of dataset.

when I press "get Next set" I get the next set of

records into the dataset but how do I get these

records to show in UltraGrid? (or refresh

bindingsource ??)

I have tried refreshAll() but that does not help.

Currently you need to do:

bindingSource1:Handle = ?.

/* get data */

bindingSource1:Handle = dataset handle.

This will cause the ProBindingSource to reopen its internal queries and refresh the data.

If you just want to add a batch of data, take a look at the batching samples posted on this forum.

-- peter

Posted by Admin on 19-Sep-2008 04:41

Thanks Peter.

I thought that but when I re-assign the handle it gives me an error "no record is avail" (91).

This errors come only if I do it through the offend event trigger. If I say, create a button (fetch next set) and on click of button fill the dataset and reassign the handle it all works fine.

When I debugged it, it creates the row in ultragrid but when it goes to the wait-for it gives this error.

Any ideas where I am going wrong?

TIA.

Parul.

Posted by rbf on 19-Sep-2008 06:07

Did you properly adjust the RowsAdded property of the ProBindingSource in the offEnd trigger?

Posted by Admin on 19-Sep-2008 10:59

Thanks Peter.

Yes I was not getting the RowsAdded right and was relying on FILL to get the next batch.

Saw the samples posted for batching, it is all coming together now.

Samples are really very useful in understanding the concepts. ( a bit complicated though but thats just me trying to figure out weres and whats)

Thanks everybody.

-Parul.

This thread is closed