Consultor Eletrônico



Kbase P182840: How to find the record in the data source corresponding to the active row of an data-bound control
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   18/02/2011
Status: Unverified

GOAL:

How to find the record in the data source corresponding to the active row of an data-bound control

GOAL:

How to find the record in the underlying temp-table corresponding to the active row of an UltraGrid

GOAL:

How to access the record in the underlying table that matches the active row of a DataGrid

FACT(s) (Environment):

Windows
OpenEdge 10.2x

FIX:

Use the Position property of Progress.Data.BindingSource to find the zero-based position in the data source of the active row in a data-bound control such as the UltraGrid. Use the Handle property of the BindingSource to access the data source itself.
Note that OpenEdge data sources such as database tables, temp-tables, and queries are one-based. It is necessary to add or subtract one to convert values back and forth from OpenEdge data source currency properties to the BindingSource Position property.
If a handle to the underlying data source is available to the module containing the data-bound control, a currency property such as the CURRENT-RESULT-ROW property of a query handle can be accessed directly. The control (UltraGrid, DataGrid, etc.), the BindingSource, and the underlying data source are all kept synchronized by the BindingSource.