Skip to content

RefreshDataFromSelectedRow - cDbCJGrid

Refreshes existing data in a dynamic grid based on the RowId in the current SelectedRow

Type: Procedure

Syntax

Procedure RefreshDataFromSelectedRow

Call Example

Send RefreshDataFromSelectedRow

Description

RefreshDataFromSelectedRow can be used to refresh data in an existing grid based around the RowID in the SelectedRow. The message will reload and refresh the grid while attempting to keep the SelectedRow in the same row position.

This can only be used with grids that use dynamic datasources, such as the cDbCJGrid, which uses a cDbCJGridDataSource. RefreshDataFromSelectedRow clears the current datasource and refreshes it by refinding the record in the SelectedRow and then filling in the records around it. Upon completion, SelectedRow will contain the same RowId, but the actual SelectedRow number may change because the datasource has been reloaded. SelectedColumn will be unchanged.

Object oRefresh is a Button
    Set Location to 249 211
    Set Label to 'Refresh'

    Procedure OnClick
        Send RefreshDataFromSelectedRow of oCustGrid        
    End_Procedure

End_Object

This should only be used with dynamic grids. It cannot be used with cCJGrids and it should only be used with cDbCJGrids if the grid is non-static (the pbStaticData property is false). The message is supported at the cCJGrid level so that developers could create their own dynamic sub-classes using their own custom dynamic datasources.

RefreshDataFromMatchingRow can be used to refresh data in a grid based around a RowId.

It is the developer's responsibility to make sure that the target record for this refresh is a valid record. It must exist and it must be constraint valid. If the record is not valid, the refresh will not succeed and the HandleCacheError method will be called. When HandleCacheError is called, it will handle this condition by refreshing the grid and, if pbSuppressCacheError is False, reporting an error.