I have a problem with the paging and refresh ultragrid.
The BindingSource is activated with batching.
Triggering event "Offend" is OK.
The search for the next page and the loading of this page in the dataset is OK (checked by WRITE-XML Dataset)
But Ultragrid only displays the first page.
This is an extract of code in the event Offend (bsAdrTiers=BindingSource and ds_AdrTiers=DataSet):
RUN IN ucGetBatchingAdrTiers gh_tmwtiersu
(INPUT li_size,
INPUT-OUTPUT gr_nextRowid,
INPUT-OUTPUT gl_lastBatch,
OUTPUT DATASET ds_AdrTiers BY-REFERENCE).
THIS-OBJECT: bsAdrTiers: RefreshAll ().
ultraGrid1: DataBind ().
IF gl_lastBatch = true
THEN bsAdrTiers: Batching = FALSE.
methods "refreshall" and "DataBind" do not trigger the display of the 2nd page, even if I move at end of this first page.
Has anyone a suggest ?
Hi,
Thank you for your email. I'm currently out of the office enjoying a vacation. I will return on April 4. During my absence I will have no access to email or voice mail. For urgent matters, call our office or contact Gary Calcott (gcalcott@progress.com).
Best regards,
Wouter
--
Wouter Dupré
Senior Solutions Consultant
Progress Software NV
A. Stocletlaan 202 B | B-2570 Duffel | Belgium
Office +32 (0) 15 30 77 00 | Mobile +32 (0) 478 50 00 49
Do you reopen the query? Thats required.
You need to add two things:
1. Return the number of records to be added from the server.
This information is needed to set the RowsAddes property
of the second parameter of the OffEnd event.
Unfortunately the dataset cannot return this information automatically,
so you have to count the records on the server and return it in an
extra parameter.
2. You must repopen the query after setting RowsAdded.
Try this code:
/* Suppress OffEnd events during this method */
bsAdrTiers:Batching = FALSE.
RUN IN ucGetBatchingAdrTiers gh_tmwtiersu
(INPUT li_size,
INPUT-OUTPUT gr_nextRowid,
INPUT-OUTPUT gl_lastBatch,
OUTPUT gi_records,
OUTPUT DATASET ds_AdrTiers BY-REFERENCE).
args:RowsAdded = gi_records.
DATASET ds_AdrTiers:TOP-NAV-QUERY:QUERY-OPEN().
bsAdrTiers:Batching = (NOT gl_lastBatch).
-peter
Thanks everyone for your quick and efficient assistance
I couldn't reopen the query because my bindingsource is linked to my dataset (not to a query).
I solved my problem with the last proposal.
Great !
A prodataset creates a query for every contained table, either as a TOP-NAV-QUERY or attached to the parent DATA-RELATION.
Yes, in fact, i didn't know this method "TOP-NAV-QUERY" wich provides access to the query of the dataset !...