LOCAL lcOrder lcOrder = SET('order') && Save current tag THIS.SetOrder(m.loCalledBy.PARENT.CONTROLSOURCE) IF this.lShowSortingArrows AND NOT SET('order')== m.lcOrderI need to also remember last sort order (asc/desc)
*---------------------- Location Section ------------------------ * Library: Acustomcontrols.vcx * Class: Grdsorting * Method: Headerclick() *----------------------- Usage Section -------------------------- *) Description: Custom method which fires when Header is clicked (idea from Barbara Peisch) *) * Scope: Public * Parameters: *$ Usage: *$ * Returns: *--------------------- Maintenance Section ---------------------- * Change Log: * CREATED 01/06/2005 - NN * MODIFIED *---------------------------------------------------------------- LOCAL loCalledBy AS OBJECT AEVENTS[aCurEvent,0] loCalledBy = aCurEvent[1] && should be a Header object IF VARTYPE(m.loCalledBy)= "O" AND NOT EMPTY(m.loCalledBy.PARENT.CONTROLSOURCE) LOCAL lcOrder, lcRecSource, llDirection lcRecSource = THIS.RECORDSOURCE llDirection = THIS.lAscending lcOrder = ORDER(m.lcRecSource) && Saves current tag THIS.SetOrder(m.loCalledBy.PARENT.CONTROLSOURCE) IF THIS.lShowSortingArrows * Check, if we changed the order IF NOT ORDER(m.lcRecSource)== m.lcOrder OR m.llDirection <> THIS.lAscending ** Clear the picture of the previously sorted column THIS.ClearHeaderPictures() THIS.SetHeaderPicture(m.loCalledBy) ENDIF ENDIF ENDIF