How to refresh a browsing DataGroup
The following ways refresh DataGroups that displaying rows of data:
1. By the user by sorting or filtering form‘s data columns.
2. By appending, modifying, or deleting rows using Forms in ptAppend, ptEdit, or ptDelete mode. Those forms usually are opened by pressing buttons or double-clicking rows on the Browsing Form. In this case, in the “Data Group“ of the browsing form, the properties “Unique Table“ and “Unique Field“ must be set and be compatible with the appending, modifying, or deleting Forms. This type of refresh occurs only in DataGroups that belong in Forms that open in ptBrowse mode.
3. Programmatically. We are giving some examples below:
Example 1.
f = TopForm()
pp = PByName(f,datagroupname)
call OpenFormModal(“ptEdit“,.....) {code execution waits until the form is closed}
call LoadRows(pp) {pp is the data group that we must refresh}
Example 2.
f = TopForm()
pp = PByName(f,datagroupname)
call OpenFormTop(“ptEdit“,....) {here the code execution does not wait and goes to the following line...}
So into the code of the opening form, we can put:
proc Form_End ( uvalue )
call LoadRows(pp) {pp is the data group that we must refresh (belongs to the previous form)}
end
Example 3.
f = TopForm()
pp = PByName(f,datagroupname)
call OpenFormTop(“ptEdit“,....) {here the code execution does not wait and goes to the following line...}
So into the code of the opening form, we can put:
proc Form_End ( uvalue )
call RefreshActiveRow ( fprev, datagroupname, uval ) { only the active row of the browser we refresh }
end
If the data group that we must refresh is of “local“ type, then before the calling of LoadRows we must append the following two rows:
call TFreeClientDataSet(tt) {where tt is the dataset of the refreshing DataGroup}
call Panels_Start() {...rerun the code that created tt}