DEFINE DATASET dsetMyrecurs FOR ttEmp
DATA-RELATION drel1 FOR ttEmp, ttEmp RELATION-FIELDS(Emp-name, Manager) RECURSIVE. |
USING Infragistics.Win.UltraWinGrid.* FROM ASSEMBLY.
PROCEDURE ultraGrid1_AfterSortChange: /* Progress.Data.BindingSource */ DEFINE INPUT PARAMETER sender AS System.Object. DEFINE INPUT PARAMETER eventArgs AS BandEventArgs. DEFINE VARIABLE sortColumn AS UltraGridColumn NO-UNDO. DEFINE VARIABLE sortString AS CHARACTER NO-UNDO. DEFINE VARIABLE cBandKey AS CHARACTER NO-UNDO. /* cOriginalWhereString to be set from initial drelHdl:WHERE-STRING */ DEFINE VARIABLE cOriginalWhereString AS CHARACTER NO-UNDO. DEFINE VARIABLE drelHdl AS HANDLE NO-UNDO. sortColumn = CAST(eventArgs:Band:SortedColumns[0], UltraGridColumn). IF sortColumn:Band:Key BEGINS "ttemp" THEN ASSIGN cBandKey = "ttemp". ELSE ASSIGN cBandKey = sortColumn:Band:Key. sortString = " BY " + cBandKey + "." + sortColumn:Key. IF EnumHelper:AreEqual (sortColumn:SortIndicator, SortIndicator:Descending) THEN sortString = sortString + " DESCENDING". ASSIGN drelHdl = DATA-RELATION drel1:HANDLE /* From the dsetMyrecurs example */ drelHdl:WHERE-STRING = cOriginalWhereString + " " + sortString. CAST(sender, Progress.Data.BindingSource):RefreshAll( ). END. |