How to refresh a browsing DataGroup

DataGroups that displaying rows of data are refreshed by the following ways:

1. By the user by sorting or filtering Form's data columns.

2. By appending, modifying or deleting rows by 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 belog in Forms that open in ptBrowse mode.

3. Programmaticaly. Some examples are given 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 datagroup that must be refreshed}

example 2.

    f = TopForm()
    pp = PByName(f,datagroupname)

    call OpenFormTop("ptEdit",....)     {here the code execution do not wait and goes to the next line...}

    ....so into the code of the opening form we can put:

    proc Form_End ( uvalue )

           call LoadRows(pp)             {pp is the datagroup that must be refreshed (belongs to previous fom)}

    end

example 3.

    f = TopForm()
    pp = PByName(f,datagroupname)

    call OpenFormTop("ptEdit",....)     {here the code execution do not wait and goes to the next 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 is refreshed }

    end

If the datagroups that must be refreshed is of "local" type then before the calling of LoadRows the following two rows must be appended:

    call TFreeClientDataSet(tt)       {where tt is the dataset of the refreshig DataGroup}
   calll Panels_Start()                  {...rerun the code that created tt}