Consultor Eletrônico



Kbase P169654: 4GL/ABL: UltraGrid column sorting is not in sync with the probinding source.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   7/12/2010
Status: Unverified

SYMPTOM(s):

4GL/ABL: UltraGrid column sorting is not in sync with the probinding source.

When a column is the UltraGrid control is sorted, the probinding is not sorted accordingly.

FACT(s) (Environment):

Windows
OpenEdge 10.2B

CAUSE:

This is expected behavior. The probinding source is by default not aware of any sorting activities the the UltraGrid control performs.

FIX:

Synchronize column sorting between the UltraGrid control and its binding source by creating an UltraGrid control AfterSortChange event handler similar to the following:
METHOD PRIVATE VOID moUltraGridCustomer_AfterSortChange ( INPUT sender AS System.Object, INPUT e AS Infragistics.Win.UltraWinGrid.BandEventArgs ):
DEFINE VARIABLE oSortColumn AS UltraGridColumn NO-UNDO.
DEFINE VARIABLE iColumn AS INTEGER NO-UNDO .
DEFINE VARIABLE cSortString AS CHARACTER NO-UNDO INIT "".
DEFINE VARIABLE oBand AS UltraGridBand NO-UNDO.

IF Progress.Util.EnumHelper:AreEqual(moUltraGridCustomer:DisplayLayout:Override:HeaderClickAction, HeaderClickAction:SortMulti) OR
Progress.Util.EnumHelper:AreEqual (moUltraGridCustomer:DisplayLayout:Override:HeaderClickAction, HeaderClickAction:SortSingle) THEN RETURN.

oBand = e:Band.
DO iColumn = 0 TO oBand:SortedColumns:Count - 1:
oSortColumn = CAST (oBand:SortedColumns[iColumn],UltraGridColumn).
cSortString = cSortString + (IF iColumn > 0 THEN "," ELSE "") + oSortColumn:KEY + "," + (IF Progress.Util.EnumHelper:AreEqual(oSortColumn:SortIndicator, SortIndicator:Descending) THEN " DESCENDING " ELSE " ").
END.
moCustomerModel:SortData(INPUT cSortString).
RETURN.
END METHOD.